/** * Helpers for the CSS-valued Elemental properties (`font_size`, `line_height`, * document `padding`). * * The backend validates these at save/render time and silently drops anything * that doesn't match — see `api/send/validation/schema/css-values.ts` in the * backend repo. The regexes here mirror that contract so the designer never * writes a value the renderer will throw away: * * font_size px only "18px" * line_height px or unitless multiplier "24px" | "1.5" * padding 1-4 space-separated lengths, "8px 30px" | "0 30px" * each a bare 0 or a px value * * Internally the designer stores font size / line height as plain px numbers, * because every editor control for them is a px number input. A unitless * `line_height` coming from an API-authored template is therefore resolved * against the effective font size on import (see `lineHeightToPx`). */ /** px only — matches the backend CSS_PX_REGEX. */ export declare const CSS_PX_REGEX: RegExp; /** px length or unitless multiplier — matches the backend CSS_LINE_HEIGHT_REGEX. */ export declare const CSS_LINE_HEIGHT_REGEX: RegExp; /** 1-4 space-separated lengths, each a bare `0` or a px value. */ export declare const CSS_PADDING_REGEX: RegExp; /** * Parse an Elemental px value (e.g. "18px") into a number. * Returns undefined for anything the backend would reject. */ export declare const parsePxValue: (value?: string | null) => number | undefined; /** Serialize a px number back to Elemental form. Drops non-positive/invalid input. */ export declare const formatPxValue: (value?: number | null) => string | undefined; /** * Resolve an Elemental `line_height` to px. * * A unitless multiplier is only meaningful relative to a font size, so it is * multiplied by `effectiveFontSize` (the block's own `font_size` when set, * otherwise the tier preset). Keeps the editor's px control honest and * round-trips as px, which is also what the renderer prefers — Outlook * mishandles unitless line-heights. */ export declare const lineHeightToPx: (value: string | undefined | null, effectiveFontSize: number) => number | undefined; export interface PaddingSides { top: number; right: number; bottom: number; left: number; } /** * Expand a CSS padding shorthand into its four sides, following the standard * 1/2/3/4-value rules. Returns undefined when the value isn't a shorthand the * backend accepts. */ export declare const parsePaddingShorthand: (value?: string | null) => PaddingSides | undefined; /** * Collapse a padding shorthand to the vertical/horizontal pair the simplified * Frame control exposes. Asymmetric 3/4-value shorthands (authored via API or * the advanced view) fall back to their top/left sides for display. */ export declare const paddingShorthandToVH: (value?: string | null) => { vertical: number; horizontal: number; } | undefined; /** Build the `vertical horizontal` shorthand the Frame control writes. */ export declare const formatPaddingVH: (vertical: number, horizontal: number) => string;