@reticular/speakable 1.3.0 → 1.4.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
@@ -750,4 +750,656 @@ declare function buildAccessibilityTree(rootElement: Element, sourceHash?: strin
750
750
  */
751
751
  declare function buildAccessibilityTreeWithSelector(rootElement: Element, selector: string, sourceHash?: string): TreeBuildResult[];
752
752
 
753
- export { type AccessibilityIssue, type AccessibleNode, type AccessibleRole, type AccessibleState, type AccessibleValue, type AnnouncementModel, type AuditReport, type AuditStatistics, CURRENT_MODEL_VERSION, type ChangeType, type DescriptionComputationResult, type DeserializationOptions, type FocusInfo, type IssueSeverity, type ModelVersion, type NameComputationResult, type NameComputationWarning, type NodeChange, type NodePath, type ParseResult, ParsingError, type ParsingWarning, type PropertyChange, type RoleComputationResult, type RoleComputationWarning, SUPPORTED_ROLES, SelectorError, type SemanticDiff, type SerializationOptions, type StateExtractionResult, type StateExtractionWarning, type TreeBuildResult, type TreeBuildWarning, ValidationError, type ValueExtractionResult, buildAccessibilityTree, buildAccessibilityTreeWithSelector, cloneModel, computeAccessibleDescription, computeAccessibleName, computeRole, createModel, describeChange, deserializeModel, diffAccessibilityTrees, extractFocusInfo, extractState, extractValue, formatDiffAsJSON, formatDiffAsText, formatDiffForCI, generateAuditReport, hasAccessibilityRegression, isAccessible, modelsEqual, parseHTML, parseHTMLStrict, renderAuditReport, renderJAWS, renderNVDA, renderNarrator, renderVoiceOver, serializeModel, validateHTMLNotEmpty, validateModel, validateRole, validateState, validateTreeStructure };
753
+ /**
754
+ * Runtime Accessibility Timeline - Type System
755
+ *
756
+ * Normalized event structures for representing accessibility-relevant
757
+ * changes during component interaction. All events use a discriminated
758
+ * union via the `kind` field on payloads and the `type` field on actions.
759
+ */
760
+ /**
761
+ * Classification of accessibility-relevant events observed during runtime.
762
+ */
763
+ type EventType = 'FOCUS_CHANGED' | 'ANNOUNCEMENT' | 'DOM_MUTATION' | 'ROLE_CHANGED' | 'ACCESSIBLE_NAME_CHANGED' | 'STATE_CHANGED' | 'KEYBOARD_ACTION' | 'DIALOG_OPENED' | 'DIALOG_CLOSED' | 'WARNING' | 'REGRESSION';
764
+ /**
765
+ * Identifies the DOM element targeted by an accessibility event.
766
+ */
767
+ interface EventTarget {
768
+ /** ARIA role of the target element */
769
+ role: string;
770
+ /** Computed accessible name */
771
+ accessibleName: string;
772
+ /** Stable CSS selector path for element identification */
773
+ selector: string;
774
+ }
775
+ interface FocusChangedPayload {
776
+ kind: 'focus_changed';
777
+ previousTarget: EventTarget | null;
778
+ }
779
+ interface AnnouncementPayload {
780
+ kind: 'announcement';
781
+ politeness: 'polite' | 'assertive';
782
+ text: string;
783
+ }
784
+ interface RoleChangedPayload {
785
+ kind: 'role_changed';
786
+ previousRole: string;
787
+ newRole: string;
788
+ }
789
+ interface AccessibleNameChangedPayload {
790
+ kind: 'accessible_name_changed';
791
+ previousName: string;
792
+ newName: string;
793
+ }
794
+ interface StateChangedPayload {
795
+ kind: 'state_changed';
796
+ attribute: string;
797
+ previousValue: string | boolean | null;
798
+ newValue: string | boolean | null;
799
+ }
800
+ interface DialogOpenedPayload {
801
+ kind: 'dialog_opened';
802
+ dialogName: string;
803
+ isModal: boolean;
804
+ }
805
+ interface DialogClosedPayload {
806
+ kind: 'dialog_closed';
807
+ dialogName: string;
808
+ }
809
+ interface KeyboardActionPayload {
810
+ kind: 'keyboard_action';
811
+ key: string;
812
+ modifiers: string[];
813
+ }
814
+ interface WarningPayload {
815
+ kind: 'warning';
816
+ message: string;
817
+ relatedEvent?: AccessibilityEvent;
818
+ }
819
+ /**
820
+ * Discriminated union of all event payload types.
821
+ * Use the `kind` field to narrow the type.
822
+ */
823
+ type EventPayload = FocusChangedPayload | AnnouncementPayload | RoleChangedPayload | AccessibleNameChangedPayload | StateChangedPayload | DialogOpenedPayload | DialogClosedPayload | KeyboardActionPayload | WarningPayload;
824
+ /**
825
+ * A normalized event representing a single accessibility-relevant change.
826
+ * Contains common fields for classification, timing, targeting, and
827
+ * type-specific payload data.
828
+ */
829
+ interface AccessibilityEvent {
830
+ /** Event classification */
831
+ type: EventType;
832
+ /** Milliseconds elapsed since session start */
833
+ timestamp: number;
834
+ /** Target element information */
835
+ target: EventTarget;
836
+ /** Type-specific payload data */
837
+ payload: EventPayload;
838
+ }
839
+ /**
840
+ * Discriminated union of interaction actions.
841
+ * Use the `type` field to narrow the action kind.
842
+ */
843
+ type InteractionAction = {
844
+ type: 'click';
845
+ selector: string;
846
+ } | {
847
+ type: 'tab';
848
+ } | {
849
+ type: 'shiftTab';
850
+ } | {
851
+ type: 'escape';
852
+ } | {
853
+ type: 'enter';
854
+ } | {
855
+ type: 'space';
856
+ } | {
857
+ type: 'arrowUp';
858
+ } | {
859
+ type: 'arrowDown';
860
+ } | {
861
+ type: 'arrowLeft';
862
+ } | {
863
+ type: 'arrowRight';
864
+ } | {
865
+ type: 'key';
866
+ combo: string;
867
+ } | {
868
+ type: 'wait';
869
+ ms: number;
870
+ };
871
+ /**
872
+ * An ordered sequence of user actions to perform during timeline capture.
873
+ */
874
+ interface InteractionSequence {
875
+ /** Human-readable description of the interaction */
876
+ description: string;
877
+ /** Ordered list of actions to perform */
878
+ actions: InteractionAction[];
879
+ }
880
+ /**
881
+ * Metadata captured alongside an accessibility timeline session.
882
+ */
883
+ interface TimelineMetadata {
884
+ /** ISO timestamp of when the timeline was captured */
885
+ capturedAt: string;
886
+ /** Speakable package version used for capture */
887
+ speakableVersion: string;
888
+ /** The URL that was analyzed */
889
+ sourceUrl: string;
890
+ /** Browser context identifier (e.g., "jsdom/23.0.0") */
891
+ userAgent: string;
892
+ }
893
+ /**
894
+ * A complete accessibility timeline captured during an interaction session.
895
+ * Contains the ordered event sequence, session metadata, and extracted warnings.
896
+ */
897
+ interface AccessibilityTimeline {
898
+ /** Timeline format version string (e.g., "1.0") */
899
+ version: string;
900
+ /** Component name */
901
+ component: string;
902
+ /** Story or variant name */
903
+ story: string | null;
904
+ /** Human-readable description of the interaction sequence performed */
905
+ interactionSequence: string;
906
+ /** Total session duration in milliseconds */
907
+ duration: number;
908
+ /** All accessibility events in chronological order */
909
+ events: AccessibilityEvent[];
910
+ /** WARNING-type events extracted for quick reference */
911
+ warnings: AccessibilityEvent[];
912
+ /** Session capture metadata */
913
+ metadata: TimelineMetadata;
914
+ }
915
+
916
+ /**
917
+ * Runtime Accessibility Engine
918
+ *
919
+ * Coordinates all accessibility observers (focus, mutation, live region, dialog)
920
+ * into a single engine that collects normalized AccessibilityEvents during
921
+ * component interaction. Events are timestamped relative to session start
922
+ * and stored in chronological order.
923
+ *
924
+ * @module runtime/engine
925
+ */
926
+
927
+ interface EngineOptions {
928
+ /** Document to observe */
929
+ document: Document;
930
+ /** Whether to enable heuristic warnings (default: true) */
931
+ heuristics?: boolean;
932
+ /** Custom settle time in ms (default: 100) */
933
+ settleTime?: number;
934
+ }
935
+ interface RuntimeAccessibilityEngine {
936
+ /** Attach observers to the document and begin event collection */
937
+ attach(): void;
938
+ /** Detach all observers and stop collection */
939
+ detach(): void;
940
+ /** Get all collected events since attach (chronological order) */
941
+ getEvents(): AccessibilityEvent[];
942
+ /** Clear collected events without detaching */
943
+ reset(): void;
944
+ /** Whether the engine is currently attached */
945
+ readonly isAttached: boolean;
946
+ /** Expose dialog observer for heuristics module */
947
+ readonly dialogObserver: {
948
+ getOpenDialogs(): string[];
949
+ };
950
+ }
951
+ /**
952
+ * Creates a RuntimeAccessibilityEngine that coordinates all observers
953
+ * and collects accessibility events with monotonically increasing timestamps.
954
+ */
955
+ declare function createEngine(options: EngineOptions): RuntimeAccessibilityEngine;
956
+
957
+ /**
958
+ * Timeline Generator
959
+ *
960
+ * Orchestrates interaction sessions by coordinating the RuntimeAccessibilityEngine
961
+ * with interaction execution and heuristic analysis. Produces complete
962
+ * AccessibilityTimeline objects containing ordered events, warnings, and
963
+ * session metadata.
964
+ *
965
+ * @module runtime/timeline-generator
966
+ */
967
+
968
+ /**
969
+ * Configuration options for creating a TimelineGenerator.
970
+ */
971
+ interface TimelineGeneratorOptions {
972
+ /** Document or iframe to attach to */
973
+ document: Document;
974
+ /** Component name for metadata */
975
+ componentName: string;
976
+ /** Story or variant name for metadata */
977
+ storyName?: string;
978
+ /** Settle period after last action (default: 500ms) */
979
+ settlePeriod?: number;
980
+ /** Maximum wait for document load (default: 10000ms) */
981
+ loadTimeout?: number;
982
+ /** Enable heuristic warnings (default: true) */
983
+ heuristics?: boolean;
984
+ }
985
+ /**
986
+ * Orchestrates an interaction session and produces an AccessibilityTimeline.
987
+ */
988
+ interface TimelineGenerator {
989
+ /** Execute an interaction sequence and produce a timeline */
990
+ capture(sequence: InteractionSequence): Promise<AccessibilityTimeline>;
991
+ /** Abort an in-progress capture */
992
+ abort(): void;
993
+ }
994
+ /**
995
+ * Creates a TimelineGenerator that coordinates the engine, interaction
996
+ * execution, and heuristic analysis to produce accessibility timelines.
997
+ *
998
+ * Usage:
999
+ * ```ts
1000
+ * const generator = createTimelineGenerator({
1001
+ * document: myDocument,
1002
+ * componentName: 'LoginForm',
1003
+ * storyName: 'Default',
1004
+ * });
1005
+ *
1006
+ * const timeline = await generator.capture({
1007
+ * description: 'Tab through form fields',
1008
+ * actions: [{ type: 'tab' }, { type: 'tab' }, { type: 'enter' }],
1009
+ * });
1010
+ * ```
1011
+ */
1012
+ declare function createTimelineGenerator(options: TimelineGeneratorOptions): TimelineGenerator;
1013
+
1014
+ /**
1015
+ * Interaction Execution
1016
+ *
1017
+ * Executes interaction sequences against a document, dispatching proper
1018
+ * DOM events (keyboard, mouse, focus) and emitting KEYBOARD_ACTION
1019
+ * accessibility events for each action.
1020
+ *
1021
+ * @module runtime/interactions
1022
+ */
1023
+
1024
+ /**
1025
+ * Execute a single interaction action against the document.
1026
+ *
1027
+ * For keyboard actions, dispatches proper KeyboardEvent sequences (keydown, keypress, keyup).
1028
+ * For tab/shiftTab, computes next/previous focusable element and moves focus.
1029
+ * Emits KEYBOARD_ACTION events for each keyboard action.
1030
+ * Handles missing elements by emitting WARNING events and continuing.
1031
+ *
1032
+ * Click and wait actions do not emit KEYBOARD_ACTION events.
1033
+ */
1034
+ declare function executeAction(action: InteractionAction, document: Document, onEvent: (event: AccessibilityEvent) => void, getTimestamp: () => number): Promise<void>;
1035
+ /**
1036
+ * Execute an interaction sequence in order, with DOM stability waits between actions.
1037
+ *
1038
+ * Runs each action sequentially, waiting for `settleTime` milliseconds between actions
1039
+ * to allow the DOM to stabilize. This ensures observers can capture resulting changes
1040
+ * before the next action fires.
1041
+ *
1042
+ * @param sequence - The interaction sequence to execute
1043
+ * @param document - The target document
1044
+ * @param onEvent - Callback to emit accessibility events
1045
+ * @param getTimestamp - Function returning current timestamp in ms since session start
1046
+ * @param settleTime - Milliseconds to wait between actions for DOM stability (default: 100)
1047
+ */
1048
+ declare function executeSequence(sequence: InteractionSequence, document: Document, onEvent: (event: AccessibilityEvent) => void, getTimestamp: () => number, settleTime?: number): Promise<void>;
1049
+
1050
+ /**
1051
+ * Built-in Interaction Patterns
1052
+ *
1053
+ * Provides pre-defined interaction sequences for common ARIA widget patterns.
1054
+ * Each pattern exercises standard keyboard interaction behavior as defined by
1055
+ * the WAI-ARIA Authoring Practices. Patterns use configurable selectors that
1056
+ * can be overridden to match component-specific markup.
1057
+ *
1058
+ * @module runtime/patterns
1059
+ */
1060
+
1061
+ /**
1062
+ * Optional map of CSS selectors to override defaults for built-in patterns.
1063
+ *
1064
+ * - `trigger` — element that opens/activates the widget
1065
+ * - `container` — wrapper/container element for the widget
1066
+ * - `content` — the content region within the widget
1067
+ * - `items` — individual items within the widget (options, tabs, etc.)
1068
+ * - `input` — text input element within the widget
1069
+ */
1070
+ interface PatternSelectorMap {
1071
+ trigger?: string;
1072
+ container?: string;
1073
+ content?: string;
1074
+ items?: string;
1075
+ input?: string;
1076
+ }
1077
+ /**
1078
+ * Names of built-in interaction patterns.
1079
+ */
1080
+ type BuiltinPatternName = 'modal-dialog' | 'combobox' | 'tabs' | 'accordion';
1081
+ /**
1082
+ * Get a built-in interaction pattern by name.
1083
+ *
1084
+ * Each pattern returns an InteractionSequence with a descriptive name and the
1085
+ * appropriate actions for testing common ARIA widget patterns. Optional selectors
1086
+ * can override the defaults used to locate trigger, container, and content elements.
1087
+ *
1088
+ * Default selectors:
1089
+ * - modal-dialog: trigger = 'button', container = '[role="dialog"], dialog'
1090
+ * - combobox: input = '[role="combobox"], input[type="text"]', items = '[role="option"]'
1091
+ * - tabs: container = '[role="tablist"]', items = '[role="tab"]'
1092
+ * - accordion: trigger = 'button[aria-expanded]'
1093
+ *
1094
+ * @param name - The built-in pattern name
1095
+ * @param selectors - Optional CSS selectors to override defaults
1096
+ * @returns An InteractionSequence representing the pattern
1097
+ */
1098
+ declare function getBuiltinPattern(name: BuiltinPatternName, selectors?: PatternSelectorMap): InteractionSequence;
1099
+
1100
+ /**
1101
+ * Heuristic Warning Analyzer
1102
+ *
1103
+ * Processes accessibility events one at a time and emits WARNING events
1104
+ * when common runtime accessibility anti-patterns are detected. Operates
1105
+ * independently of baselines, providing value from the first run.
1106
+ *
1107
+ * Detected patterns:
1108
+ * - Focus not moved into modal dialog within configured timeout (default: 100ms)
1109
+ * - Focus escaped modal dialog (focus moved to element outside open dialog)
1110
+ * - Rapid announcements (too many in a short window)
1111
+ * - Keyboard action with no accessibility response within timeout
1112
+ * - Focused element removed from DOM without explicit focus management
1113
+ *
1114
+ * Uses event timestamps (not real-time timers) for timeout detection,
1115
+ * enabling deterministic testing with jsdom.
1116
+ *
1117
+ * @module runtime/heuristics
1118
+ */
1119
+
1120
+ /**
1121
+ * Configuration for heuristic warning thresholds.
1122
+ */
1123
+ interface HeuristicConfig {
1124
+ /** Time window to detect focus moving into dialog (default: 100ms) */
1125
+ dialogFocusTimeout: number;
1126
+ /** Time window to detect rapid announcements (default: 500ms) */
1127
+ rapidAnnouncementWindow: number;
1128
+ /** Threshold for rapid announcement count (default: 3) */
1129
+ rapidAnnouncementThreshold: number;
1130
+ /** Time window to detect keyboard action response (default: 200ms) */
1131
+ keyboardResponseTimeout: number;
1132
+ }
1133
+ /**
1134
+ * Processes accessibility events and detects runtime anti-patterns.
1135
+ */
1136
+ interface HeuristicAnalyzer {
1137
+ /** Process an event and return any warnings it triggers */
1138
+ process(event: AccessibilityEvent): AccessibilityEvent[];
1139
+ /** Get current open dialog selectors (for focus escape detection) */
1140
+ readonly openDialogs: string[];
1141
+ }
1142
+ /**
1143
+ * Creates a heuristic analyzer that processes accessibility events and
1144
+ * emits warnings when common anti-patterns are detected.
1145
+ *
1146
+ * The analyzer uses event timestamps for timeout detection rather than
1147
+ * real-time timers, making it deterministic and testable with jsdom.
1148
+ */
1149
+ declare function createHeuristicAnalyzer(config?: Partial<HeuristicConfig>): HeuristicAnalyzer;
1150
+
1151
+ /**
1152
+ * Deterministic serialization and deserialization for Runtime Accessibility
1153
+ * Timeline types.
1154
+ *
1155
+ * All serializers produce JSON with recursively sorted keys and 2-space
1156
+ * indentation, guaranteeing:
1157
+ * - Byte-identical output for equivalent inputs (determinism)
1158
+ * - Round-trip integrity (serialize → deserialize → serialize = identical)
1159
+ * - Stable version-control diffs
1160
+ */
1161
+
1162
+ /**
1163
+ * Serializes an AccessibilityEvent to deterministic JSON with sorted keys
1164
+ * and 2-space indentation.
1165
+ *
1166
+ * @param event - The accessibility event to serialize
1167
+ * @returns Deterministic JSON string
1168
+ */
1169
+ declare function serializeEvent(event: AccessibilityEvent): string;
1170
+ /**
1171
+ * Deserializes a JSON string into a validated AccessibilityEvent.
1172
+ *
1173
+ * @param json - JSON string to parse
1174
+ * @returns Validated AccessibilityEvent
1175
+ * @throws Error if the JSON is invalid or does not conform to the event schema
1176
+ */
1177
+ declare function deserializeEvent(json: string): AccessibilityEvent;
1178
+ /**
1179
+ * Serializes an AccessibilityTimeline to deterministic JSON with sorted keys
1180
+ * and 2-space indentation.
1181
+ *
1182
+ * @param timeline - The accessibility timeline to serialize
1183
+ * @returns Deterministic JSON string
1184
+ */
1185
+ declare function serializeTimeline(timeline: AccessibilityTimeline): string;
1186
+ /**
1187
+ * Deserializes a JSON string into a validated AccessibilityTimeline.
1188
+ *
1189
+ * @param json - JSON string to parse
1190
+ * @returns Validated AccessibilityTimeline
1191
+ * @throws Error if the JSON is invalid or does not conform to the timeline schema
1192
+ */
1193
+ declare function deserializeTimeline(json: string): AccessibilityTimeline;
1194
+ /**
1195
+ * Serializes an InteractionSequence to deterministic JSON with sorted keys
1196
+ * and 2-space indentation.
1197
+ *
1198
+ * @param seq - The interaction sequence to serialize
1199
+ * @returns Deterministic JSON string
1200
+ */
1201
+ declare function serializeInteractionSequence(seq: InteractionSequence): string;
1202
+ /**
1203
+ * Deserializes a JSON string into a validated InteractionSequence.
1204
+ *
1205
+ * @param json - JSON string to parse
1206
+ * @returns Validated InteractionSequence
1207
+ * @throws Error if the JSON is invalid or does not conform to the interaction schema
1208
+ */
1209
+ declare function deserializeInteractionSequence(json: string): InteractionSequence;
1210
+ /**
1211
+ * Checks whether two AccessibilityTimelines are deeply equal by comparing
1212
+ * their deterministic serializations. Because serialization sorts keys
1213
+ * recursively, structurally equivalent timelines produce identical strings.
1214
+ *
1215
+ * @param a - First timeline
1216
+ * @param b - Second timeline
1217
+ * @returns true if timelines are equivalent
1218
+ */
1219
+ declare function timelinesEqual(a: AccessibilityTimeline, b: AccessibilityTimeline): boolean;
1220
+
1221
+ /**
1222
+ * Stable CSS Selector Generation
1223
+ *
1224
+ * Generates unique, deterministic CSS selectors for DOM elements.
1225
+ * The selector strategy prioritizes stability and readability:
1226
+ *
1227
+ * 1. If the element has an ID, return `#id`
1228
+ * 2. Walk up from the element to the document root, building a path
1229
+ * 3. At each level, try tag name alone, then tag+classes, then tag:nth-child(n)
1230
+ * 4. Stop building the path when the partial selector already uniquely identifies the element
1231
+ */
1232
+ /**
1233
+ * Generate a stable CSS selector that uniquely identifies the given element
1234
+ * within its document.
1235
+ *
1236
+ * The selector is deterministic: given the same DOM structure, the same element
1237
+ * will always produce the same selector string.
1238
+ */
1239
+ declare function generateSelector(element: Element): string;
1240
+
1241
+ /**
1242
+ * Behavior Diff Engine
1243
+ *
1244
+ * Compares two Accessibility Timelines and produces a BehaviorDiffReport
1245
+ * describing added, removed, and modified events. Events are matched by
1246
+ * type + target selector. Timestamp differences alone do not count as
1247
+ * modifications.
1248
+ */
1249
+
1250
+ /**
1251
+ * A single entry in the diff report representing one difference between
1252
+ * baseline and current timelines.
1253
+ */
1254
+ interface DiffEntry {
1255
+ /** The event from the current timeline (for added/modified) or baseline (for removed) */
1256
+ event: AccessibilityEvent;
1257
+ /** The corresponding event from the other timeline (for modified entries) */
1258
+ previousEvent?: AccessibilityEvent;
1259
+ /** Human-readable description of the difference */
1260
+ message: string;
1261
+ }
1262
+ /**
1263
+ * Structured summary of differences between two Accessibility Timelines.
1264
+ */
1265
+ interface BehaviorDiffReport {
1266
+ baseline: {
1267
+ totalEvents: number;
1268
+ };
1269
+ current: {
1270
+ totalEvents: number;
1271
+ };
1272
+ /** Events present in current but not in baseline */
1273
+ added: DiffEntry[];
1274
+ /** Events present in baseline but not in current */
1275
+ removed: DiffEntry[];
1276
+ /** Events present in both but with different payloads */
1277
+ modified: DiffEntry[];
1278
+ /** Aggregate counts (must equal array lengths exactly) */
1279
+ summary: {
1280
+ totalBaseline: number;
1281
+ totalCurrent: number;
1282
+ added: number;
1283
+ removed: number;
1284
+ modified: number;
1285
+ };
1286
+ }
1287
+ /**
1288
+ * Compare two Accessibility Timelines and produce a structured diff report.
1289
+ *
1290
+ * Algorithm:
1291
+ * 1. Create matching keys for events: type + target selector
1292
+ * 2. Walk baseline events and find matching current events
1293
+ * 3. If matched: compare payloads (ignoring timestamp). Different = modified.
1294
+ * 4. If no match in current: classify as removed
1295
+ * 5. Unmatched current events: classify as added
1296
+ * 6. Timestamp-only differences do NOT count as modifications
1297
+ */
1298
+ declare function diffTimelines(baseline: AccessibilityTimeline, current: AccessibilityTimeline): BehaviorDiffReport;
1299
+
1300
+ type SeverityLevel = 'critical' | 'high' | 'medium' | 'low';
1301
+ interface ClassifiedDiffEntry {
1302
+ event: AccessibilityEvent;
1303
+ previousEvent?: AccessibilityEvent;
1304
+ message: string;
1305
+ severity: SeverityLevel;
1306
+ }
1307
+ interface ClassifiedDiffReport {
1308
+ entries: ClassifiedDiffEntry[];
1309
+ highestSeverity: SeverityLevel | null;
1310
+ criticalCount: number;
1311
+ highCount: number;
1312
+ mediumCount: number;
1313
+ lowCount: number;
1314
+ }
1315
+ declare function classifyDiff(report: BehaviorDiffReport): ClassifiedDiffReport;
1316
+
1317
+ interface BaselineFile {
1318
+ baseline: {
1319
+ createdAt: string;
1320
+ speakableVersion: string;
1321
+ storybookUrl?: string;
1322
+ interactionSequence: string;
1323
+ };
1324
+ timeline: AccessibilityTimeline;
1325
+ }
1326
+ interface BaselineStorage {
1327
+ save(componentName: string, storyName: string, timeline: AccessibilityTimeline, meta?: {
1328
+ storybookUrl?: string;
1329
+ }): Promise<void>;
1330
+ load(componentName: string, storyName: string): Promise<BaselineFile | null>;
1331
+ exists(componentName: string, storyName: string): Promise<boolean>;
1332
+ getBaselinePath(componentName: string, storyName: string): string;
1333
+ }
1334
+ declare function createBaselineStorage(baseDir: string): BaselineStorage;
1335
+
1336
+ /**
1337
+ * Runtime Accessibility Timeline - Public API
1338
+ *
1339
+ * Exports all public types, interfaces, and factory functions for the
1340
+ * Runtime Accessibility Engine. This module provides:
1341
+ *
1342
+ * - Event type system (EventType, AccessibilityEvent, payloads)
1343
+ * - Runtime engine (createEngine)
1344
+ * - Timeline generation (createTimelineGenerator)
1345
+ * - Interaction execution (executeAction, executeSequence)
1346
+ * - Built-in patterns (getBuiltinPattern)
1347
+ * - Heuristic analysis (createHeuristicAnalyzer)
1348
+ * - Serialization (serializeTimeline, deserializeTimeline, etc.)
1349
+ * - Stable CSS selector generation (generateSelector)
1350
+ */
1351
+
1352
+ type index_AccessibilityEvent = AccessibilityEvent;
1353
+ type index_AccessibilityTimeline = AccessibilityTimeline;
1354
+ type index_AccessibleNameChangedPayload = AccessibleNameChangedPayload;
1355
+ type index_AnnouncementPayload = AnnouncementPayload;
1356
+ type index_BaselineFile = BaselineFile;
1357
+ type index_BaselineStorage = BaselineStorage;
1358
+ type index_BehaviorDiffReport = BehaviorDiffReport;
1359
+ type index_BuiltinPatternName = BuiltinPatternName;
1360
+ type index_ClassifiedDiffEntry = ClassifiedDiffEntry;
1361
+ type index_ClassifiedDiffReport = ClassifiedDiffReport;
1362
+ type index_DialogClosedPayload = DialogClosedPayload;
1363
+ type index_DialogOpenedPayload = DialogOpenedPayload;
1364
+ type index_DiffEntry = DiffEntry;
1365
+ type index_EngineOptions = EngineOptions;
1366
+ type index_EventPayload = EventPayload;
1367
+ type index_EventTarget = EventTarget;
1368
+ type index_EventType = EventType;
1369
+ type index_FocusChangedPayload = FocusChangedPayload;
1370
+ type index_HeuristicAnalyzer = HeuristicAnalyzer;
1371
+ type index_HeuristicConfig = HeuristicConfig;
1372
+ type index_InteractionAction = InteractionAction;
1373
+ type index_InteractionSequence = InteractionSequence;
1374
+ type index_KeyboardActionPayload = KeyboardActionPayload;
1375
+ type index_PatternSelectorMap = PatternSelectorMap;
1376
+ type index_RoleChangedPayload = RoleChangedPayload;
1377
+ type index_RuntimeAccessibilityEngine = RuntimeAccessibilityEngine;
1378
+ type index_SeverityLevel = SeverityLevel;
1379
+ type index_StateChangedPayload = StateChangedPayload;
1380
+ type index_TimelineGenerator = TimelineGenerator;
1381
+ type index_TimelineGeneratorOptions = TimelineGeneratorOptions;
1382
+ type index_TimelineMetadata = TimelineMetadata;
1383
+ type index_WarningPayload = WarningPayload;
1384
+ declare const index_classifyDiff: typeof classifyDiff;
1385
+ declare const index_createBaselineStorage: typeof createBaselineStorage;
1386
+ declare const index_createEngine: typeof createEngine;
1387
+ declare const index_createHeuristicAnalyzer: typeof createHeuristicAnalyzer;
1388
+ declare const index_createTimelineGenerator: typeof createTimelineGenerator;
1389
+ declare const index_deserializeEvent: typeof deserializeEvent;
1390
+ declare const index_deserializeInteractionSequence: typeof deserializeInteractionSequence;
1391
+ declare const index_deserializeTimeline: typeof deserializeTimeline;
1392
+ declare const index_diffTimelines: typeof diffTimelines;
1393
+ declare const index_executeAction: typeof executeAction;
1394
+ declare const index_executeSequence: typeof executeSequence;
1395
+ declare const index_generateSelector: typeof generateSelector;
1396
+ declare const index_getBuiltinPattern: typeof getBuiltinPattern;
1397
+ declare const index_serializeEvent: typeof serializeEvent;
1398
+ declare const index_serializeInteractionSequence: typeof serializeInteractionSequence;
1399
+ declare const index_serializeTimeline: typeof serializeTimeline;
1400
+ declare const index_timelinesEqual: typeof timelinesEqual;
1401
+ declare namespace index {
1402
+ export { type index_AccessibilityEvent as AccessibilityEvent, type index_AccessibilityTimeline as AccessibilityTimeline, type index_AccessibleNameChangedPayload as AccessibleNameChangedPayload, type index_AnnouncementPayload as AnnouncementPayload, type index_BaselineFile as BaselineFile, type index_BaselineStorage as BaselineStorage, type index_BehaviorDiffReport as BehaviorDiffReport, type index_BuiltinPatternName as BuiltinPatternName, type index_ClassifiedDiffEntry as ClassifiedDiffEntry, type index_ClassifiedDiffReport as ClassifiedDiffReport, type index_DialogClosedPayload as DialogClosedPayload, type index_DialogOpenedPayload as DialogOpenedPayload, type index_DiffEntry as DiffEntry, type index_EngineOptions as EngineOptions, type index_EventPayload as EventPayload, type index_EventTarget as EventTarget, type index_EventType as EventType, type index_FocusChangedPayload as FocusChangedPayload, type index_HeuristicAnalyzer as HeuristicAnalyzer, type index_HeuristicConfig as HeuristicConfig, type index_InteractionAction as InteractionAction, type index_InteractionSequence as InteractionSequence, type index_KeyboardActionPayload as KeyboardActionPayload, type index_PatternSelectorMap as PatternSelectorMap, type index_RoleChangedPayload as RoleChangedPayload, type index_RuntimeAccessibilityEngine as RuntimeAccessibilityEngine, type index_SeverityLevel as SeverityLevel, type index_StateChangedPayload as StateChangedPayload, type index_TimelineGenerator as TimelineGenerator, type index_TimelineGeneratorOptions as TimelineGeneratorOptions, type index_TimelineMetadata as TimelineMetadata, type index_WarningPayload as WarningPayload, index_classifyDiff as classifyDiff, index_createBaselineStorage as createBaselineStorage, index_createEngine as createEngine, index_createHeuristicAnalyzer as createHeuristicAnalyzer, index_createTimelineGenerator as createTimelineGenerator, index_deserializeEvent as deserializeEvent, index_deserializeInteractionSequence as deserializeInteractionSequence, index_deserializeTimeline as deserializeTimeline, index_diffTimelines as diffTimelines, index_executeAction as executeAction, index_executeSequence as executeSequence, index_generateSelector as generateSelector, index_getBuiltinPattern as getBuiltinPattern, index_serializeEvent as serializeEvent, index_serializeInteractionSequence as serializeInteractionSequence, index_serializeTimeline as serializeTimeline, index_timelinesEqual as timelinesEqual };
1403
+ }
1404
+
1405
+ export { type AccessibilityIssue, type AccessibleNode, type AccessibleRole, type AccessibleState, type AccessibleValue, type AnnouncementModel, type AuditReport, type AuditStatistics, CURRENT_MODEL_VERSION, type ChangeType, type DescriptionComputationResult, type DeserializationOptions, type FocusInfo, type IssueSeverity, type ModelVersion, type NameComputationResult, type NameComputationWarning, type NodeChange, type NodePath, type ParseResult, ParsingError, type ParsingWarning, type PropertyChange, type RoleComputationResult, type RoleComputationWarning, SUPPORTED_ROLES, SelectorError, type SemanticDiff, type SerializationOptions, type StateExtractionResult, type StateExtractionWarning, type TreeBuildResult, type TreeBuildWarning, ValidationError, type ValueExtractionResult, buildAccessibilityTree, buildAccessibilityTreeWithSelector, cloneModel, computeAccessibleDescription, computeAccessibleName, computeRole, createModel, describeChange, deserializeModel, diffAccessibilityTrees, extractFocusInfo, extractState, extractValue, formatDiffAsJSON, formatDiffAsText, formatDiffForCI, generateAuditReport, hasAccessibilityRegression, isAccessible, modelsEqual, parseHTML, parseHTMLStrict, renderAuditReport, renderJAWS, renderNVDA, renderNarrator, renderVoiceOver, index as runtime, serializeModel, validateHTMLNotEmpty, validateModel, validateRole, validateState, validateTreeStructure };