import { HsonAttrs, HsonMeta } from "../../../../core/types.js"; import type { RawAttr } from "../../token.types.js"; /******* * Split raw parsed attributes into `$_attrs` vs `$_meta`, applying Hson-edge decoding. * * Input: * - `RawAttr[]` emitted by the tokenizer for a single open tag. * - Each RawAttr includes: * - `name` (attribute key), * - optional `value` as `{ text, quoted }`. * * Hson metadata uses dedicated grammar (`@` and structural array order). * Attribute tokens are therefore always ordinary `$_attrs`. * * Value semantics (Hson edge, not HTML): * - Quoted values are Hson string literals and are decoded via `decode_hson_value`. * - Unquoted values are treated as raw text and trimmed. * - No HTML entity decoding is performed at this stage; this path assumes Hson * source, not external HTML. * * Special cases: * - `style`: * - If present, decode (if quoted) and parse using `parse_style_string` to * produce an object form stored at `attrs.style`. * - If present but valueless (`style` as a bare key), stores `{}`. * - Flags: * - If the attribute has no value (bare key), it is treated as a boolean-present * flag and stored as `attrs[k] = k`. * - Additionally, `disabled=""` and `disabled="disabled"` (and equivalents) are * normalized to the same flag representation (`attrs[k] = k`). * * Debug hygiene (optional): * - In non-production builds, may warn if decoded values still contain patterns * that suggest missed decoding (JSON-style escapes) or cross-edge leakage * (HTML entities). * * @param raw - Tokenizer-emitted raw attribute list for one open tag. * @returns An object containing: * - `attrs`: normalized `HsonAttrs` (including parsed `style` when present), * - `meta`: empty; retained in the return shape for parser composition. *******/ export declare function split_attrs_meta(raw: RawAttr[]): { attrs: HsonAttrs; meta: HsonMeta; }; //# sourceMappingURL=split-attrs-meta.d.ts.map