/** * Attribute Extractor * * Finds translatable HTML attribute values in the DOM and parses each * into an AttributeUnit. Pairs with BlockExtractor (text-content side) * to cover everything user-visible: * * - , , * - any element [title] * - , * - * - * * Cross-stack parity: produces the same auto_ key as BlockExtractor for * the same trimmed text — md5(text.trim()) prefix — so a button labelled * "Submit" and a paragraph "Submit" collide on key (intentional reuse). * * `` is deliberately excluded because * `value` on a plain text input is user data, not UI copy, and would * corrupt form state if treated as translatable. */ import type { AttributeUnit } from '../content/types.js'; import { type ExcludePatterns } from './exclude-filter.js'; export interface ExtractedAttribute { /** Live element carrying the attribute */ element: Element; /** HTML attribute name (e.g. `alt`, `content`) */ attrName: string; /** Translatable payload */ unit: AttributeUnit; /** auto_ key or server-stamped key */ key: string; } export declare class AttributeExtractor { private excludeFilter; private excludeSelectors; constructor(excludePatterns?: Partial, excludeSelectors?: string[], minTextLength?: number); /** * Walk the DOM under `root` and return every translatable attribute. * * @param root Element or Document to scan * @param includeStamped When true, elements already carrying * `data-lr-attr-{name}` are returned anyway — * the editor uses this to surface server-handled * attributes for inspection. The runtime keeps * the default `false` so it doesn't re-extract * what the server already keyed. */ extract(root: Element | Document, includeStamped?: boolean): ExtractedAttribute[]; private isInsideSkipTag; private hasSkipAncestor; private matchesExcludeSelector; } //# sourceMappingURL=attribute-extractor.d.ts.map