import { AllowedStyleKey, CssKey, CssVarName } from "../../../types/css.types.js"; /** * Backend contract for style reads. * * Implementations should return the *internal truth* (Hson attrs or * CssManager state), not computed styles from the browser. */ export type StyleGetMany = Readonly>; export type StyleGetterAdapters = Readonly<{ /** Return rendered string value for canonical prop, or undefined if absent. */ read: (propCanon: string) => string | undefined; /** * Optional bulk read hook for diagnostics and round-tripping into * setMany-compatible objects. Backends that cannot enumerate declarations may * omit this and get an empty object from getMany(). */ readMany?: () => StyleGetMany; }>; type ReservedGetSurfaceKey = "property" | "var" | "vars"; type DirectStyleGetKey = Exclude; export type GetSurface = { [K in DirectStyleGetKey]: () => string | undefined; } & Record string | undefined> & Record<`${string}-${string}`, () => string | undefined> & { /** Read a property by any supported CSS key spelling. */ property: (prop: CssKey) => string | undefined; /** * Read a selected list of CSS custom properties. * * Invalid names and missing declarations are omitted. Returned keys are * canonical custom-property names in `--x` form. */ vars: (names: readonly string[]) => Readonly>>; }; export type StyleGetter = GetSurface; /** * Normalize user-facing CSS custom property names. * * Accepts: * - `"--x"` canonical custom-property names * - `"x"` convenience names * - `"-x"` common single-hyphen typo/convenience names */ export declare function normalize_css_var_name(name: string): CssVarName | undefined; /** * Create the canonical bulk-read function for a style-like handle. * * This lives beside, not under, `get` so CSS property names such as `all` keep * their normal meaning on the getter proxy. */ export declare function make_style_get_many(adapters: StyleGetterAdapters): () => StyleGetMany; /** * Create a `StyleGetter` bound to a backend read adapter. * * - Normalizes property names to the canonical CSS form used by setters. * - Provides a `var()` helper that accepts either `"--x"` or `"x"`. * * @param adapters - Backend read hooks returning rendered values. * @returns A `StyleGetter` that exposes canonicalized reads. */ export declare function make_style_getter(adapters: StyleGetterAdapters): StyleGetter; export {}; //# sourceMappingURL=style-getter.d.ts.map