import type { ThemeToken, ParsedTheme } from './css-parser.js'; /** * Design token extracted from Figma. * * @property {string} name - Token name from Figma (e.g., "Primary/Blue", "Spacing/Large") * @property {string} value - Token value (e.g., "#2563eb", "16px", "0.5rem") * @property {'color'|'fontFamily'|'fontSize'|'opacity'|'other'|'radius'|'spacing'} type - Token type for matching logic * @property {string} [description] - Optional description from Figma */ export interface FigmaToken { name: string; value: string; type: 'color' | 'fontFamily' | 'fontSize' | 'opacity' | 'other' | 'radius' | 'spacing'; description?: string; } /** * Result of matching a Figma token to theme tokens. * * @property {FigmaToken} figmaToken - The Figma token that was matched * @property {ThemeToken} [matchedToken] - Best-matching theme token (if found) * @property {number} confidence - Match confidence (0-100) * @property {'exact'|'fuzzy'|'none'} matchType - 'exact', 'fuzzy', or 'none' * @property {string} reason - Human-readable explanation of the match * @property {TokenSuggestion[]} [suggestions] - Suggested new tokens or alternatives (when no match or fuzzy match) */ export interface TokenMatch { figmaToken: FigmaToken; matchedToken?: ThemeToken; confidence: number; matchType: 'exact' | 'fuzzy' | 'none'; reason: string; suggestions?: TokenSuggestion[]; } /** * Suggestion for a new or alternative theme token. * * @property {string} tokenName - Suggested CSS custom property name * @property {string} value - Token value * @property {'both'|'dark'|'light'} theme - Which theme(s) to add to: 'both', 'dark', or 'light' * @property {string} reason - Explanation for the suggestion * @property {string} [insertAfter] - Optional token name to insert after in the theme file */ export interface TokenSuggestion { tokenName: string; value: string; theme: 'both' | 'dark' | 'light'; reason: string; insertAfter?: string; } /** * Matches a single Figma token to existing theme tokens. * * @param figmaToken - Figma design token to match * @param parsedTheme - Parsed theme from app.css * @returns TokenMatch with exact, fuzzy, or no match and optional suggestions */ export declare function matchToken(figmaToken: FigmaToken, parsedTheme: ParsedTheme): TokenMatch; /** * Matches multiple Figma tokens to existing theme tokens. * * @param figmaTokens - Array of Figma design tokens to match * @param parsedTheme - Parsed theme from app.css * @returns Array of TokenMatch results, one per input token */ export declare function matchTokens(figmaTokens: FigmaToken[], parsedTheme: ParsedTheme): TokenMatch[];