import { _ as TokenGraph, g as TokenMap, h as SwatchbookToken, i as AxisVarianceResult, v as TokenGraphNode, y as WriteValue } from "../types-Cwn0Uyq2.mjs"; //#region src/token-graph/walk.d.ts /** * Resolve a single token to its leaf value at `tuple` — the foundational * single-token resolution primitive every other resolver in this module * builds on. Walks direct writes (last-wins across axes in project order), * alias targets, and partial-alias composition until it reaches a literal. * Returns `undefined` for a path not in the graph or one whose alias chain * fails to resolve. Cycle-safe: a self-referential chain falls back to the * node's baseline value rather than looping. */ declare function resolveAt(graph: TokenGraph, path: string, tuple: Record): SwatchbookToken | undefined; /** * Resolve every token in the graph to its leaf value at `tuple` — the * project-wide counterpart to `resolveAt`, sharing one cycle-detection memo * across all paths. The primitive the CSS emitter, the loader's * `defaultTokens` snapshot, and `getVariance`'s per-context sampling all * build on. Paths that fail to resolve are omitted from the result rather * than included as `undefined`. */ declare function resolveAllAt(graph: TokenGraph, tuple: Record): TokenMap; /** * Like `resolveAt`, but stops at the first alias/partial-alias write * (or baseline structure) and returns the alias view instead of * recursing to a leaf. Returned token retains the source path's * structural shape — useful for emitters that need to reference * `aliasOf` to emit `var(--…)` references rather than literal values. * * - Literal at this tuple → returns the literal token (same as `resolveAt`). * - Alias at this tuple → returns a token with `aliasOf: ` and * `$value: ` (preserves alias provenance). * - Partial-alias at this tuple → returns a token with `partialAliasOf: ` * and `$value: ` (preserves which fields are aliased). */ declare function resolveAliasAt(graph: TokenGraph, path: string, tuple: Record): SwatchbookToken | undefined; /** * The full forward alias chain for `path` at `tuple` — the target paths it * resolves through, hop by hop, to the final literal, e.g. * `['color.brand', 'color.palette.blue.500']`. Each hop's immediate target is * whatever `resolveAliasAt` resolves at this tuple (per-tuple alias write, * else baseline alias), so the chain is correct in every axis context, not * just the default. Empty for a literal. Visited-set bounds cycles. */ declare function aliasChainAt(graph: TokenGraph, path: string, tuple: Record): string[]; declare function resolveAliasAllAt(graph: TokenGraph, tuple: Record): TokenMap; /** * Browser display resolver: every token's resolved leaf `$value` (same as * `resolveAllAt`) plus correct, tuple-aware alias provenance — the full * forward `aliasChain` / immediate `aliasOf` (from `aliasChainAt`) and the * graph node's structural-union `aliasedBy` (project-scoped reverse edges, * stable across tuples). This is the source of truth for alias indicators; * `resolveAllAt` stays the pure-leaf resolver the CSS emitter and `load.ts` * use. Aliases keep their OWN provenance even when their target varies by * axis (the defect this fixes: `resolveAllAt` substitutes the target's). */ declare function resolveAllWithProvenanceAt(graph: TokenGraph, tuple: Record): TokenMap; //#endregion //#region src/token-graph/queries.d.ts /** * Axis names that affect `path`'s resolved value anywhere in the project — * a thin accessor over the graph node's precomputed `affectedBy` set. * Empty array (never `undefined`) for a constant token or a path not in * the graph. */ declare function getAffectedBy(graph: TokenGraph, path: string): readonly string[]; /** * Every token path in the graph, sorted lexicographically. The sort order * is a stated contract, not an incidental side effect of `Object.keys` — * consumers may rely on it for stable iteration (deterministic emission * order, diffable snapshots) without re-sorting themselves. */ declare function listPaths(graph: TokenGraph): readonly string[]; /** * Compute how `path`'s resolved value varies across the project's axes. * For each axis, samples the token's value in every one of that axis's * contexts while holding every other axis at its default (`perAxis`) — * this isolates each axis's individual effect rather than reporting joint * behavior. `kind` discriminates on how many axes the resolved value * actually differs across: `constant` (none), `single` (exactly one), or * `multi` (two or more); see `AxisVarianceResult` for the per-kind fields. */ declare function getVariance(graph: TokenGraph, path: string): AxisVarianceResult; //#endregion export { type TokenGraph, type TokenGraphNode, type WriteValue, aliasChainAt, getAffectedBy, getVariance, listPaths, resolveAliasAllAt, resolveAliasAt, resolveAllAt, resolveAllWithProvenanceAt, resolveAt }; //# sourceMappingURL=index.d.mts.map