/** * Shared utilities for flux renderers. * * Each renderer imports from here to keep variant-driven style composition * consistent and to funnel the React-element → FluxElement cast through a * single audited location. */ import * as React from "react"; import type { CSSProperties, ReactElement, ReactNode } from "react"; import type { FluxElement, FluxRenderContext } from "./types.js"; /** * Cast a React element to the structural FluxElement interface. The * generated types intentionally keep FluxElement react-agnostic; this * shim is the single boundary where we accept the narrowing. */ export declare function asFluxElement(element: ReactElement): FluxElement; /** Shorthand for ``React.createElement`` with a narrowed FluxElement return. */ export declare function h(type: string | React.ComponentType>, props: Record | null, ...children: ReactNode[]): ReactElement; /** * Build a CSS variable reference string. * * tokenVar("color.primary.solid") → "var(--flux-color-primary-solid)" */ export declare function tokenVar(path: string, fallback?: string): string; /** * Resolve a single value from the flux catalog's variant style shape. If * the value starts with ``$``, convert to a ``var(--flux-…)`` reference; * otherwise pass through untouched. */ export declare function resolveValue(value: unknown): unknown; /** * Convert an object of token-referencing style properties to a runtime * CSSProperties object. Also converts camelCase CSS props to the shape * React expects (React already uses camelCase — so this is largely a * token-resolution pass with type narrowing). */ export declare function resolveStyle(style: Record | undefined): CSSProperties; /** * Merge an ordered list of style dicts. Later entries win. Undefined * values are treated as "don't set". */ export declare function mergeStyles(...styles: Array): CSSProperties; /** Look up a slot node (by id) via ctx.renderers. */ export declare function renderSlot(slotId: unknown, ctx: FluxRenderContext, parentId: string, slotName: string): ReactElement | null; /** Return the first non-nullish value. */ export declare function firstDefined(...values: Array): T | undefined; //# sourceMappingURL=_shared.d.ts.map