import type { DesignSystemGraph, TokenAxis } from "../types.js"; export declare const DEFAULT_SPACING_SCALE: readonly number[]; export declare const NUMERIC_AXES: readonly TokenAxis[]; /** * WHY: graph raw values are not uniformly bare numbers — only `spacing` is * px-stripped upstream, and `motion` carries a `duration/` or `easing/` prefix * (see graph/extract/tokens.ts#canonicalRawValue). * * Lengths normalize to px, assuming a 16px root font size: `rem`/`em` are * multiplied by 16, `px` and unitless (graph dimension values are already * px-stripped upstream, so unitless already means px) pass through unchanged. * 16px is the CSS default and near-universal in real stylesheets, so this is * the right default assumption — without it, a scale authored in rem (e.g. * `--space-1: 0.25rem`) never matches code that uses the equivalent px value * (`padding: 4px`), silently under-reporting real drift as `novel` instead of * `exact`. A repo that overrides the root font size will see its rem/em * tokens land a fixed offset away from matching px code — that surfaces as * the advisory `near`/`novel` classes, never as a false `exact`, so the * blast radius of the assumption being wrong is bounded by the class system. */ export declare function numericValue(rawValue: string): number | null; export interface DerivedScale { scale: number[]; /** * True when NO token on the axis yielded a numeric value, so `scale` is the * built-in default (or empty for an axis that has none). Callers need this to * tell "on the scale, anchored by a token" from "on the scale, but no token * anchors it" — the fallback scale still knows the answer, it just has no * token id to name. This flag is the single source of truth for that * condition: deriving it independently (e.g. "does the axis have any token") * diverges here, because a token whose value is non-numeric (`auto`) counts * for that test but not for this one. */ isFallback: boolean; } export declare function deriveScaleInfo(graph: DesignSystemGraph, axis: TokenAxis): DerivedScale; export declare function deriveScale(graph: DesignSystemGraph, axis: TokenAxis): number[]; /** * Distance from `value` to the scale, expressed in scale positions (0 = the * value IS on the scale). `Number.POSITIVE_INFINITY` means "no answer" — the * caller must not read it as a large-but-real distance. * * PRECONDITION: `scale` must be sorted ascending (as deriveScale returns it) — * neighbour lookups by index assume that order. */ export declare function stepDistance(scale: readonly number[], value: number): number;