import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, f as TokenDataMap, i as buildTokens, n as ProcessSetsOptions, a as ProcessResult, l as TokenData, o as ProcessOptions, g as TokenOperationResult, p as RefPath } from './types-C7cwAlzN.js';
export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, j as TokenResolver, U as UpdateTokenParams, h as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-C7cwAlzN.js';
import { d as InterpreterResult } from './interpreter-CgnLEVGZ.js';
import './types-DSZPf9oj.js';
import 'arktype/internal/variants/object.ts';

type FlattenCallback<T> = (key: string, value: InterpreterResult) => T;
/**
 * Flatten a DictionarySymbol into key-value pairs
 *
 * @param result - The InterpreterResult to flatten (only DictionarySymbol will be flattened)
 * @param prefix - The prefix to prepend to keys
 * @param callback - Callback function that receives each flattened key-value pair
 *
 * @example
 * const result: Record<string, unknown> = {};
 * flattenChildrenObject(dictionarySymbol, "root", (key, value) => {
 *   result[key] = value;
 * });
 */
declare function flattenChildrenObject<T>(result: InterpreterResult, prefix: string, callback: FlattenCallback<T>): void;
/**
 * Flatten a Map structure into key-value pairs
 *
 * @param map - The map to flatten (from Dictionary.value)
 * @param prefix - The prefix to prepend to keys
 * @param callback - Callback function that receives each flattened key-value pair
 *
 * @example
 * const result = new Map<string, unknown>();
 * flattenChildrenMap(dictionarySymbol.value, "root", (key, value) => {
 *   result.set(key, value);
 * });
 */
declare function flattenChildrenMap<T>(map: Map<string, InterpreterResult>, prefix: string, callback: FlattenCallback<T>): void;

declare class MapBuilder implements TokenBuilder<Map<string, string | InterpreterResult>> {
    readonly name = "map";
    protected result: Map<string, string | InterpreterResult>;
    private successfullyResolved;
    onResolve(tokenName: string, value: InterpreterResult): void;
    onError(tokenName: string, _error: Error, originalValue: string | unknown): void;
    getResult(): Map<string, string | InterpreterResult>;
    getResolvedTokens(): Map<string, InterpreterResult>;
}

/**
 * Nested Object Builder
 *
 * Builds a nested object structure incrementally as tokens are resolved.
 * Converts flat token paths to nested structure.
 * Example: "color.primary" -> { color: { primary: value } }
 */
declare class NestedObjectBuilder implements TokenBuilder<Record<string, unknown>> {
    readonly name = "nested";
    private result;
    onResolve(tokenName: string, value: InterpreterResult): void;
    onError(tokenName: string, _error: Error, originalValue: string | unknown): void;
    getResult(): Record<string, unknown>;
}
/**
 * Flat Object Builder
 *
 * Builds a flat key-value object incrementally as tokens are resolved.
 * Example: "color.primary" -> { "color.primary": value }
 */
declare class FlatObjectBuilder implements TokenBuilder<Record<string, unknown>> {
    readonly name = "flat";
    private result;
    onResolve(tokenName: string, value: InterpreterResult): void;
    onError(tokenName: string, _error: Error, originalValue: string | unknown): void;
    getResult(): Record<string, unknown>;
}

declare class StringMapBuilder extends MapBuilder {
    onResolve(tokenName: string, value: InterpreterResult): void;
    getResult(): Map<string, string>;
}

declare const index_BuildTokensOptions: typeof BuildTokensOptions;
declare const index_BuilderFormat: typeof BuilderFormat;
type index_FlatObjectBuilder = FlatObjectBuilder;
declare const index_FlatObjectBuilder: typeof FlatObjectBuilder;
type index_FlattenCallback<T> = FlattenCallback<T>;
type index_MapBuilder = MapBuilder;
declare const index_MapBuilder: typeof MapBuilder;
type index_NestedObjectBuilder = NestedObjectBuilder;
declare const index_NestedObjectBuilder: typeof NestedObjectBuilder;
type index_StringMapBuilder = StringMapBuilder;
declare const index_StringMapBuilder: typeof StringMapBuilder;
declare const index_TokenBuilder: typeof TokenBuilder;
declare const index_TokenDataMap: typeof TokenDataMap;
declare const index_buildTokens: typeof buildTokens;
declare const index_flattenChildrenMap: typeof flattenChildrenMap;
declare const index_flattenChildrenObject: typeof flattenChildrenObject;
declare namespace index {
  export { index_BuildTokensOptions as BuildTokensOptions, index_BuilderFormat as BuilderFormat, index_FlatObjectBuilder as FlatObjectBuilder, type index_FlattenCallback as FlattenCallback, index_MapBuilder as MapBuilder, index_NestedObjectBuilder as NestedObjectBuilder, index_StringMapBuilder as StringMapBuilder, index_TokenBuilder as TokenBuilder, index_TokenDataMap as TokenDataMap, index_buildTokens as buildTokens, index_flattenChildrenMap as flattenChildrenMap, index_flattenChildrenObject as flattenChildrenObject };
}

/**
 * Process flat token collection.
 *
 * @param tokens - Token input in various formats (Map or Record)
 * @param options - Processing options
 * @returns Processed tokens with resolved values
 *
 * @note Performance optimization: If you already have a `Map<string, TokenData>`,
 * you can skip this function and call `buildTokens` directly to avoid unnecessary flattening.
 */
declare function processTokens<T = Map<string, string | InterpreterResult>>(tokens: Map<string, TokenData> | Map<string, string> | Record<string, any>, options?: ProcessOptions): ProcessResult<T>;
/**
 * Process token sets with theme or set selection.
 */
declare function processTokenSets<T = Map<string, string | InterpreterResult>>(normalizedFiles: Record<string, unknown>, options?: ProcessSetsOptions): ProcessResult<T>;

/**
 * Get all affected token paths from the dependants graph.
 * Returns the set of all tokens that depend on the changed token.
 */
declare function getAffectedTokens(result: TokenOperationResult): Set<RefPath>;
/**
 * Get broken references from issues.
 * Filters issues for TOKEN_NOT_FOUND or DEPENDENCY_ERROR codes.
 */
declare function getBrokenReferences(result: TokenOperationResult): Set<RefPath>;
/**
 * For rename operations: get tokens whose references were updated.
 * Pass the set of tokens that were modified during rename.
 */
declare function getRenamedReferences(_result: TokenOperationResult, modifiedTokens: Set<RefPath>): Set<RefPath>;
/**
 * Get tokens from the dependants graph whose values actually changed.
 * Compares the old token values with the new result to filter only modified tokens.
 */
declare function getModifiedDependants(oldTokens: Map<RefPath, any>, result: TokenOperationResult): Set<RefPath>;

export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens };
