src/lib/form/extractors/label-strategy.interface.ts
Symbols by Kind
interface
2
type
1
method
1
All Symbols
| Name | Kind | Visibility | Status | Lines | Signature |
|---|---|---|---|---|---|
| LabelStrategyName | type | exported- | 8-18 | type LabelStrategyName |
|
| LabelResult | interface | exported- | 20-23 | interface LabelResult |
|
| LabelStrategy | interface | exported- | 25-28 | interface LabelStrategy |
|
| find | method | - | 27-27 | find(element: HTMLElement): : LabelResult | null |
Full Source
/**
* Label Strategy Interface
*
* Each strategy knows how to find a label for a given element
* using one specific technique (e.g. label[for], aria-label, framework-specific).
*/
export type LabelStrategyName =
| "label[for]"
| "parent-label"
| "aria-label"
| "aria-labelledby"
| "prev-label"
| "title"
| "fieldset-legend"
| "form-group-label"
| "prev-sibling-text"
| "placeholder";
export interface LabelResult {
text: string;
strategy: LabelStrategyName;
}
export interface LabelStrategy {
readonly name: LabelStrategyName;
find(element: HTMLElement): LabelResult | null;
}