export interface ObserveAriaLabelOptions { /** * Leave the attribute on the host. Use it when the host itself carries the role the label * names; the default moves the label off the host so it is announced once, on the inner * element that owns the role. */ keepOnHost?: boolean; } /** * Reads the consumer's `aria-label` from a component host now and on every later change, * and reports it through `onChange` (`undefined` when empty). * * Components read the native attribute instead of declaring an `ariaLabel` prop, which would * shadow `HTMLElement.prototype.ariaLabel` (#88). Setting the `ariaLabel` property still works: * the platform reflects it to the attribute, and the observer picks that write up. * * With the default stripping, the attribute is gone once read, so a label is cleared by setting * it to an empty string rather than by removing it. Without `MutationObserver` (the hydrate * build, mock-doc) only the value present at call time is read. * * @returns A function that stops observing; call it from `disconnectedCallback`. */ export declare const observeAriaLabel: (host: HTMLElement, onChange: (label: string | undefined) => void, { keepOnHost }?: ObserveAriaLabelOptions) => (() => void); export interface HostAriaLabel { /** Re-applies the fallback; call it when an input to the fallback changes. */ update(): void; /** * Stops observing and takes the component's own fallback off the host, so a later reconnect * does not read it back as the consumer's label; call it from `disconnectedCallback`. */ stop(): void; } /** * Names a host that carries its role itself: the consumer's `aria-label` stays on the host and * wins; while there is none (or it is empty), the host gets `fallback()`, removed when that * returns `undefined`. */ export declare const nameHostWithFallback: (host: HTMLElement, fallback: () => string | undefined) => HostAriaLabel;