/** * The references a widget's parts must make to each other. * * Dimension 3 of the specification. These relations existed in two places and neither was the * contract: the projections emit them at runtime, and the conformance inspector re-stated the rules * in its own code. A rule that lives only in the checker cannot be read by someone implementing the * widget, which is precisely what this contract is supposed to make possible. * * Declaring them also changes what can be caught. The inspector could only ever find a reference * that pointed at nothing — a *dangling* id. A control carrying no reference at all has nothing to * dangle, so a field whose errors reach no assistive technology looked identical to one with no * errors. */ import { type MdyWidgetKind } from "./catalog.js"; /** The attributes that carry a reference from one part to another. */ export type MdyRelationAttribute = "for" | "aria-describedby" | "aria-labelledby" | "aria-controls" | "aria-activedescendant"; export interface MdyWidgetRelation { /** The part carrying the attribute. */ readonly from: string; readonly attribute: MdyRelationAttribute; /** * The parts it may name, in order of preference. The first one *rendered* is the one it must * name — `aria-describedby` points at the error list while there is one and at the supporting * text otherwise, and both are the same relation rather than two. */ readonly to: readonly string[]; } /** Every relation each kind's parts must make, derived from one declaration per relation type. */ export declare const MDY_WIDGET_RELATIONS: Readonly>; /** * Elements a `for` may legitimately name. * * The HTML rule, not a preference: `label[for]` resolves only to a labelable element, so naming * anything else is markup a browser ignores. */ export declare const MDY_LABELABLE_TAGS: readonly string[]; /** * How a part comes by its accessible name. * * Dimension 2's remaining half. `element` says what a part *is* and the relations say what it points * at; this says how a screen reader is supposed to announce it. */ export type MdyAccessibleNameSource = /** The host language does it: a `