import { CssVarFacade } from "../../../types/css.types.js"; import { LiveTree } from "../livetree.js"; import { StyleSetter } from "./style-setter.js"; import { StyleGetMany, StyleGetter } from "./style-getter.js"; export declare const parse_style_attr: (raw: string | undefined) => Map; /** * Inline style manager bound to a single `LiveTree` node. * * Responsibilities: * - Provides a typed, DX-friendly facade over inline styles via `set` * and `setProperty`. * - Keeps Hson `$_attrs.style` and the DOM element's `style` attribute * in sync through helpers such as `applyStyleToNode` and * `removeStyleFromNode`. * - Exposes runtime-derived style keys (via `keys()`) that represent * the actual properties supported in the current environment. * * This manager is per-node: each `StyleManager` instance operates on * the `LiveTree` it was constructed with, not on selections. */ export declare class StyleManager { private readonly tree; private readonly runtimeKeys; readonly setter: StyleSetter; readonly getter: StyleGetter; /** Bulk-read declarations from this inline style scope. */ readonly getMany: () => StyleGetMany; /** Unified custom-property helper for this inline style scope. */ readonly var: CssVarFacade; /** * Create a `StyleManager` for a given `LiveTree`. * * Implementation details: * - Stores the `LiveTree` instance for all subsequent style operations. * - Computes `runtimeKeys` once via `computeRuntimeKeys()`, probing the * runtime for supported style properties. * - Builds `setter` via `make_style_setter`, producing a fluent style API. * * @param tree - The `LiveTree` whose node (and mapped DOM element) will * be styled by this manager. * @see computeRuntimeKeys * @see make_style_setter */ constructor(tree: TTree); /** * Set a single inline style property on this node. * * Behavior: * - Accepts property names in camelCase or kebab-case. * - CamelCase names are normalized to kebab-case via `camel_to_kebab`, * except for custom properties starting with `--`, which are left * as-is. * - `value`: * - `null` or `undefined` → treated as `""` and removes the declaration. * - string/number → converted to string and applied as-is (units are * the caller's responsibility). * - Delegates to `applyStyleToNode`, which updates both the Hson node * and the corresponding DOM element. * * @param propertyName - CSS property name in camelCase or kebab-case. * @param value - New value for the property, or `null` to remove it. * @returns The underlying `LiveTree` instance, for chaining. * @see applyStyleToNode */ private apply; /** * Remove a single inline style property from this node. * * Behavior: * - Normalizes the property name from camelCase to kebab-case (except * for `--custom` variables). * - Delegates to `removeStyleFromNode`, which clears the property from * the node's style object and the DOM `style` attribute. * * This is equivalent to calling `setProperty(propertyName, null)` but * uses the dedicated removal pathway. * * @param propertyName - CSS property name in camelCase or kebab-case. * @returns The underlying `LiveTree` instance, for chaining. * @see removeStyleFromNode */ private remove; /** * Remove all inline style state from the current tree node. * * This clears style at both layers: * - the internal Hson representation (`node.$_attrs.style`), and * - the live DOM element’s inline `style` attribute, if present. * * This method is intentionally **destructive and local**: * - it does not affect QUID-scoped CSS rules managed by `CssManager`, * - it does not traverse or modify child nodes, * - it does not trigger any re-rendering beyond the immediate DOM mutation. * * It is used internally to support operations like `cssReplace`, reset-style * semantics, or teardown paths where inline styles must be fully discarded. * * If the node has no attributes or no associated DOM element, the operation * is a no-op. */ private clearAll; } //# sourceMappingURL=style-manager.d.ts.map