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/core

How this code works

  1. 01
    Install core

    Use core in any JavaScript runtime, including tests that do not have a document.

  2. 02
    Add 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.

CategoryExportsReference
RuntimecreateGenerativeA11y, GenerativeA11yRuntime/api/core/create-generative-a11y
EventsGenerativeA11yEvent and lifecycle types/api/core/events
Policypresets, resolvePolicy, PolicyOverrides/api/core/policy
SchedulercreateAnnouncementScheduler and scheduler types/api/core/scheduler
TestingManualClock, createAnnouncementRecorder/api/core/testing
DiagnosticsAnnouncementIntent, AnnouncementDiagnostic/api/core/diagnostics