@html-validate/w3c-data
v1.20260301.0
Published
Machine readable data scraped from W3C specifications
Readme
HTML-Validate W3C data
This project contains scraped data from W3C specifications:
- WAI-ARIA
This package is not meant for public consumption and breaking changes can occur between any version. Use at your own risk!
WAI-ARIA
The package provides machine-readable data about WAI-ARIA roles, properties, and states scraped from the W3C specification.
import aria from "@html-validate/w3c-data/aria";The default export is an object containing all ARIA roles with their metadata:
console.log(aria["alert"].category); // "live"
console.log(aria["alert"].superclasses); // ["section"]
console.log(aria["alert"].properties["aria-atomic"]); // { inherited: true, required: false, deprecated: false, default: "true" }Each role contains:
role- Role namecategory- Role category (abstract,widget,structure,landmark,live, orwindow)superclasses- List of roles this role inherits fromsubclasses- List of roles that inherit from this roleproperties- Available ARIA properties for this rolestates- Available ARIA states for this rolename- Accessible name requirementsfromAuthor- Name can be set from authorfromContents- Name can be set from contentprohibited- Name must not be setrequired- Name is required
requiredParent- List of required parent rolesallowedChildren- List of allowed child roleschildrenPresentational- Whether DOM descendants are presentational
Each property and state in the properties and states objects contains:
inherited(boolean) - Whether the attribute is inherited from a superclass rolerequired(boolean) - Whether the attribute is required for this roledeprecated(boolean) - Whether the attribute is deprecateddefault(string | undefined) - The default value of the attribute, if any
Note: All property and state keys include the aria- prefix (e.g., "aria-atomic", "aria-expanded").
The package provides helper functions and types for working with ARIA roles:
isValidRole(role: string): role is AriaRole: checks if a string is a valid ARIA role name.getRoleData(role: string): NormalizedRole | null: get ARIA role metadata for given role.AriaRole- Union type of all ARIA role names
Versioning
This package does not follow semantic versioning but rather the date of the last time it was scraped. Breaking changes can occur between any changes.
