Core
@generative-a11y/core
Core events, announcement rules, streaming text, scheduling, diagnostics, test clocks, and recorders.
Install and import
Core does not depend on the DOM, React, or an AI framework. Your app sends it GenerativeA11yEvent objects, and it creates AnnouncementIntent objects when there is something useful to announce.
shell
npm install @generative-a11y/coreHow this code works
- 01Install core
Use core in any JavaScript runtime, including tests that do not have a document.
- 02Add browser delivery
Browser apps pair core with @generative-a11y/dom or @generative-a11y/react.
Public export map
Use the narrowest public export for the behavior you own.
| Category | Exports | Reference |
|---|---|---|
| Runtime | createGenerativeA11y, GenerativeA11yRuntime | /api/core/create-generative-a11y |
| Events | GenerativeA11yEvent and lifecycle types | /api/core/events |
| Policy | presets, resolvePolicy, PolicyOverrides | /api/core/policy |
| Scheduler | createAnnouncementScheduler and scheduler types | /api/core/scheduler |
| Testing | ManualClock, createAnnouncementRecorder | /api/core/testing |
| Diagnostics | AnnouncementIntent, AnnouncementDiagnostic | /api/core/diagnostics |