import { Color, Constants, Fn, Token as Token$1, Unit } from '@tokens-studio/schema-validation';

declare enum Operations {
    SUBTRACT = "-",
    ADD = "+",
    MULTIPLY = "*",
    DIVIDE = "/",
    POWER = "^",
    LOGIC_AND = "&&",
    LOGIC_OR = "||",
    LOGIC_NOT = "!"
}
declare enum SupportedFormats {
    PX = "px",
    EM = "em",
    REM = "rem",
    VW = "vw",
    VH = "vh",
    PT = "pt",
    IN = "in",
    CM = "cm",
    MM = "mm",
    DEG = "deg",
    PERCENTAGE = "%",
    S = "s",
    MS = "ms",
    CH = "ch"
}
declare enum ReservedKeyword {
    TRUE = "true",
    FALSE = "false",
    NULL = "null",
    UNDEFINED = "undefined",
    WHILE = "while",
    IF = "if",
    ELSE = "else",
    ELIF = "elif",
    RETURN = "return",
    VARIABLE = "variable",
    FOR = "for"
}
declare enum TokenType {
    REFERENCE = "REFERENCE",
    NUMBER = "NUMBER",
    OPERATION = "OPERATION",
    FORMAT = "FORMAT",
    LPAREN = "LPAREN",
    RPAREN = "RPAREN",
    EOF = "EOF",
    COMMA = "COMMA",
    HEX_COLOR = "HEX_COLOR",
    STRING = "STRING",
    EXPLICIT_STRING = "EXPLICIT_STRING",
    TEMPLATE_STRING = "TEMPLATE_STRING",
    ASSIGN = "ASSIGN",
    IS_EQ = "IS_EQ",
    IS_GT = "GT",
    IS_LT = "LT",
    IS_GT_EQ = "IS_GT_EQ",
    IS_LT_EQ = "IS_LT_EQ",
    IS_NOT_EQ = "IS_NOT_EQ",
    RESERVED_KEYWORD = "RESERVED_KEYWORD",
    SEMICOLON = "SEMICOLON",
    LOGIC_NOT = "LOGIC_NOT",
    COLON = "COLON",
    DOT = "DOT",
    LOGIC_AND = "LOGIC_AND",
    LOGIC_OR = "LOGIC_OR",
    LBLOCK = "LBLOCK",
    RBLOCK = "RBLOCK",
    PARTIAL_REFERENCE = "PARTIAL_REFERENCE",
    PARTIAL_STRING = "PARTIAL_STRING"
}
interface Token {
    type: TokenType;
    value: any;
    line: number;
    pos: number;
    endPos: number;
}
interface ASTNode {
    token?: Token;
    nodeType: string;
}
/**
 * Metadata attached to a symbol that is preserved across cloning operations.
 * This data is not accessible to the tokenscript language itself and is intended
 * for external use (e.g., storing token IDs for tracing).
 */
type SymbolMetadata = Record<string, unknown>;
interface ISymbolType {
    type: string;
    value: any;
    /**
     * Optional metadata attached to this symbol.
     * This is a reference that is preserved (not cloned) during deepCopy/cloneIfMutable operations.
     * It is not accessible to the tokenscript language and is intended for external use.
     */
    metadata?: SymbolMetadata;
    cloneIfMutable(): ISymbolType;
    deepCopy(): ISymbolType;
    typeEquals(other: ISymbolType): boolean;
    equals(other: ISymbolType): boolean;
    validValue(value: any): boolean;
    toJSON?(): any;
    toString(): string;
    getTypeName(): string;
    toJs(options?: {
        recursive?: boolean;
        stringify?: boolean;
    }): any;
    hasMethod?(methodName: string, args: ISymbolType[]): boolean;
    callMethod?(methodName: string, args: ISymbolType[]): ISymbolType | null | undefined;
    hasAttribute?(attributeName: string): boolean;
    getAttribute?(attributeName: string): ISymbolType | null;
    setAttribute?(attributeName: string, value: ISymbolType, config?: Config): void;
}
declare const UNINTERPRETED_KEYWORDS: string[];
type ReferenceRecordValue = string | number | ISymbolType;
type ReferenceRecord = Record<string, ReferenceRecordValue | Array<ReferenceRecordValue>>;

declare class IdentifierNode implements ASTNode {
    token: Token;
    nodeType: string;
    name: string;
    constructor(token: Token);
}
declare class ReassignNode implements ASTNode {
    identifier: IdentifierNode | IdentifierNode[];
    value: ASTNode;
    token?: Token | undefined;
    nodeType: string;
    constructor(identifier: IdentifierNode | IdentifierNode[], value: ASTNode, token?: Token | undefined);
    baseIdentifier(): IdentifierNode;
    isAttributeAssignment(): boolean;
    identifierToString(): string;
    attributesChain(): IdentifierNode[];
    attributesStringChain(): string[];
}

interface ToJsOptions {
    /** Whether to recursively convert nested values (default: true) */
    recursive?: boolean;
    /** Whether to use toString() for structured types (default: false) */
    stringify?: boolean;
}
type SupportedMethods = Record<string, MethodDefinitionDef>;
interface MethodArgumentDef {
    name: string;
    type: any;
    optional?: boolean;
}
interface MethodDefinitionDef {
    name?: string;
    function: (...args: any[]) => ISymbolType | null | undefined;
    args: MethodArgumentDef[];
    returnType: any;
}
declare abstract class BaseSymbolType implements ISymbolType {
    abstract type: string;
    value: any | null;
    config?: Config;
    static _SUPPORTED_METHODS?: SupportedMethods;
    constructor(value: any, config?: Config);
    abstract validValue(value: any): boolean;
    /**
     * Forces creating a deepCopy of provided symbol no matter if it's immutable or not.
     */
    abstract deepCopy(): ISymbolType;
    /**
     * Returns a copy of the symbol if it's mutable, otherwise returns the same instance.
     *
     * This method is used to prevent reference sharing issues when storing symbols in
     * containers like lists and dictionaries. Immutable symbols (Number, String, Boolean,
     * NumberWithUnit, Null, hex ColorSymbol) can safely share references since they
     * cannot be modified after creation. Mutable symbols (List, Dictionary, dynamic
     * ColorSymbol) need to be deep copied to prevent unintended mutations.
     *
     * @returns For immutable symbols: returns `this` (same reference)
     *          For mutable symbols: returns `this.deepCopy()` (new instance)
     */
    abstract cloneIfMutable(): ISymbolType;
    abstract toJs(options?: ToJsOptions): JsValue;
    toString(): string;
    getTypeName(): string;
    typeEquals(other: ISymbolType): boolean;
    equals(other: ISymbolType): boolean;
    hasMethod?(methodName: string, args: ISymbolType[]): boolean;
    callMethod?(methodName: string, args: ISymbolType[]): ISymbolType | null | undefined;
    hasAttribute?(_attributeName: string): boolean;
    getAttribute?(attributeName: string): ISymbolType | null;
    setAttribute?(attributeName: string, _value: ISymbolType): void;
}
type NumberValue = number | null;
declare class NumberSymbol extends BaseSymbolType {
    type: string;
    static readonly type = "Number";
    static _SUPPORTED_METHODS: {
        to_string: {
            name: string;
            function: (this: NumberSymbol, radix?: NumberSymbol) => StringSymbol;
            args: {
                name: string;
                type: string;
                optional: boolean;
            }[];
            returnType: string;
        };
    };
    value: NumberValue;
    constructor(value: number | NumberSymbol | NumberWithUnitSymbol | null, config?: Config);
    validValue(val: any): boolean;
    expectSafeValue(val: any): asserts val is number;
    toString(): string;
    deepCopy(): NumberSymbol;
    cloneIfMutable(): NumberSymbol;
    static empty(): NumberSymbol;
    hasAttribute(attributeName: string): boolean;
    getAttribute(attributeName: string): ISymbolType | null;
    toStringSymbol(radix?: NumberSymbol): StringSymbol;
    toJs(_options?: ToJsOptions): NumberValue;
}
type StringValue = string | null;
declare class StringSymbol extends BaseSymbolType {
    type: string;
    static readonly type = "String";
    static _SUPPORTED_METHODS: {
        upper: {
            function: (this: StringSymbol) => StringSymbol;
            args: never[];
            returnType: string;
        };
        lower: {
            function: (this: StringSymbol) => StringSymbol;
            args: never[];
            returnType: string;
        };
        length: {
            function: (this: StringSymbol) => NumberSymbol;
            args: never[];
            returnType: string;
        };
        concat: {
            function: (this: StringSymbol, other: StringSymbol) => StringSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        split: {
            function: (this: StringSymbol, delimiter?: StringSymbol) => ListSymbol;
            args: {
                name: string;
                type: string;
                optional: boolean;
            }[];
            returnType: string;
        };
    };
    value: StringValue;
    constructor(value: string | StringSymbol | null, config?: Config);
    validValue(val: any): boolean;
    expectSafeValue(val: any): asserts val is string;
    upper(): StringSymbol;
    deepCopy(): StringSymbol;
    cloneIfMutable(): StringSymbol;
    static empty(): StringSymbol;
    lower(): StringSymbol;
    length(): NumberSymbol;
    concat(other: StringSymbol): StringSymbol;
    split(delimiter?: StringSymbol): ListSymbol;
    toJs(_options?: ToJsOptions): StringValue;
}
declare class ListSymbol extends BaseSymbolType {
    type: string;
    static readonly type = "List";
    static _SUPPORTED_METHODS: {
        append: {
            function: (this: ListSymbol, item: ISymbolType) => ListSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        extend: {
            function: (this: ListSymbol, ...items: ISymbolType[]) => ListSymbol;
            args: never[];
            returnType: string;
        };
        insert: {
            function: (this: ListSymbol, index: NumberSymbol, item: ISymbolType) => ListSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        delete: {
            function: (this: ListSymbol, index: NumberSymbol) => ListSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        length: {
            function: (this: ListSymbol) => NumberSymbol;
            args: never[];
            returnType: string;
        };
        index: {
            function: (this: ListSymbol, item: ISymbolType) => NumberSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        get: {
            function: (this: ListSymbol, index: NumberSymbol) => ISymbolType;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        update: {
            function: (this: ListSymbol, index: NumberSymbol, item: ISymbolType) => ListSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        join: {
            function: (this: ListSymbol, separator?: StringSymbol) => StringSymbol;
            args: {
                name: string;
                type: string;
                optional: boolean;
            }[];
            returnType: string;
        };
    };
    value: ISymbolType[];
    isImplicit: boolean;
    constructor(elements: ISymbolType[] | null, isImplicit?: boolean, config?: Config);
    validValue(val: any): boolean;
    toString(): string;
    append(item: ISymbolType): ListSymbol;
    extend(...items: ISymbolType[]): ListSymbol;
    insert(indexSymbol: NumberSymbol, item: ISymbolType): ListSymbol;
    delete(indexSymbol: NumberSymbol): ListSymbol;
    length(): NumberSymbol;
    index(item: ISymbolType): NumberSymbol;
    get(indexSymbol: NumberSymbol): ISymbolType;
    update(indexSymbol: NumberSymbol, item: ISymbolType): ListSymbol;
    join(separator?: StringSymbol): StringSymbol;
    deepCopy(): ListSymbol;
    cloneIfMutable(): ListSymbol;
    static empty(): ListSymbol;
    getTypeName(): string;
    toJs(options?: ToJsOptions): JsValue[];
}
type NumberWithUnitValue = number | null;
declare class NumberWithUnitSymbol extends BaseSymbolType {
    type: string;
    static readonly type = "NumberWithUnit";
    static _SUPPORTED_METHODS: {
        to_string: {
            name: string;
            function: (this: NumberWithUnitSymbol) => StringSymbol;
            args: {
                name: string;
                type: string;
                optional: boolean;
            }[];
            returnType: string;
        };
        to_number: {
            function: (this: NumberWithUnitSymbol) => NumberSymbol;
            args: never[];
            returnType: string;
        };
    };
    value: NumberWithUnitValue;
    unit: SupportedFormats;
    constructor(value: number | NumberSymbol | null, unit: SupportedFormats | string, config?: Config);
    validValue(val: any): boolean;
    static fromRecord(record: {
        value: number | string;
        unit: string;
        type?: string;
    }, config?: Config): NumberWithUnitSymbol | undefined;
    toString(): string;
    expectSafeValue(val: any): asserts val is number;
    toStringSymbol(): StringSymbol;
    to_number(): NumberSymbol;
    equals(other: ISymbolType): boolean;
    deepCopy(): NumberWithUnitSymbol;
    cloneIfMutable(): NumberWithUnitSymbol;
    static empty(): NumberWithUnitSymbol;
    hasAttribute(attributeName: string): boolean;
    getAttribute(attributeName: string): ISymbolType | null;
    getTypeName(): string;
    toJs(options?: ToJsOptions): string | {
        value: number | null;
        unit: string;
    };
}
type TokenValue = Map<string, ISymbolType> | ISymbolType[];
declare class TokenSymbol extends BaseSymbolType {
    type: string;
    static readonly type = "Token";
    static _SUPPORTED_METHODS: {
        get: {
            function: (this: TokenSymbol, keyOrIndex: StringSymbol | NumberSymbol) => ISymbolType;
            args: {
                name: string;
                type: string;
                optional: boolean;
            }[];
            returnType: string;
        };
        set: {
            function: (this: TokenSymbol, key: StringSymbol, value: ISymbolType) => TokenSymbol;
            args: {
                name: string;
                type: string;
                optional: boolean;
            }[];
            returnType: string;
        };
        keys: {
            function: (this: TokenSymbol) => ListSymbol;
            args: never[];
            returnType: string;
        };
        values: {
            function: (this: TokenSymbol) => ListSymbol;
            args: never[];
            returnType: string;
        };
        length: {
            function: (this: TokenSymbol) => NumberSymbol;
            args: never[];
            returnType: string;
        };
        append: {
            function: (this: TokenSymbol, item: ISymbolType) => TokenSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        extend: {
            function: (this: TokenSymbol, ...items: ISymbolType[]) => TokenSymbol;
            args: never[];
            returnType: string;
        };
        insert: {
            function: (this: TokenSymbol, index: NumberSymbol, item: ISymbolType) => TokenSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        delete: {
            function: (this: TokenSymbol, index: NumberSymbol) => TokenSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        index: {
            function: (this: TokenSymbol, item: ISymbolType) => NumberSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        update: {
            function: (this: TokenSymbol, index: NumberSymbol, item: ISymbolType) => TokenSymbol;
            args: {
                name: string;
                type: string;
            }[];
            returnType: string;
        };
        join: {
            function: (this: TokenSymbol, separator?: StringSymbol) => StringSymbol;
            args: {
                name: string;
                type: string;
                optional: boolean;
            }[];
            returnType: string;
        };
    };
    subType: string;
    value: TokenValue;
    /**
     * Optional metadata attached to this token.
     * This is a reference that is preserved (not cloned) during deepCopy/cloneIfMutable operations.
     * It is not accessible to the tokenscript language and is intended for external use
     * (e.g., storing token IDs for tracing).
     */
    metadata?: SymbolMetadata;
    constructor(subType: string, value: TokenValue | Record<string, ISymbolType> | TokenSymbol | null, config?: Config, metadata?: SymbolMetadata);
    validValue(val: any): boolean;
    toString(): string;
    get(keyOrIndex: StringSymbol | NumberSymbol | string | number): ISymbolType;
    set(key: StringSymbol, value: ISymbolType): TokenSymbol;
    keys(): ListSymbol;
    values(): ListSymbol;
    length(): NumberSymbol;
    append(item: ISymbolType): TokenSymbol;
    extend(...items: ISymbolType[]): TokenSymbol;
    insert(indexSymbol: NumberSymbol, item: ISymbolType): TokenSymbol;
    delete(indexSymbol: NumberSymbol): TokenSymbol;
    index(item: ISymbolType): NumberSymbol;
    update(indexSymbol: NumberSymbol, item: ISymbolType): TokenSymbol;
    join(separator?: StringSymbol): StringSymbol;
    deepCopy(): TokenSymbol;
    cloneIfMutable(): TokenSymbol;
    static empty(): TokenSymbol;
    hasAttribute(attributeName: string): boolean;
    getAttribute(attributeName: string): ISymbolType | null;
    getTypeName(): string;
    toJs(options?: ToJsOptions): JsValue[] | Record<string, JsValue>;
}
type dynamicColorValue = Record<string, ISymbolType>;
type ColorValue = string | dynamicColorValue | null;
declare class ColorSymbol extends BaseSymbolType {
    type: string;
    static readonly type = "Color";
    static _SUPPORTED_METHODS: {
        to_string: {
            name: string;
            function: (this: ColorSymbol) => StringSymbol;
            args: never[];
            returnType: string;
        };
    };
    subType: string | null;
    value: ColorValue;
    alpha: number | null;
    static empty(): ColorSymbol;
    constructor(value: ColorValue, subType?: string, alpha?: number | null, config?: Config);
    toStringSymbol(): StringSymbol;
    toString(): string;
    to(targetType: string): ColorSymbol;
    typeEquals(other: ISymbolType): boolean;
    isHex(): boolean;
    validValue(val: any): boolean;
    equals(other: ISymbolType): boolean;
    deepCopy(): ColorSymbol;
    cloneIfMutable(): ColorSymbol;
    hasAttribute(attributeName: string): boolean;
    getAttribute(attributeName: string): ISymbolType | null;
    hasMethod(methodName: string, args: ISymbolType[]): boolean;
    callMethod(methodName: string, args: ISymbolType[]): ISymbolType | null | undefined;
    getTypeName(): string;
    toJs(options?: ToJsOptions): string | Record<string, JsValue>;
}
/**
 * Represents a JavaScript value that can be produced from a TokenScript symbol.
 * This includes primitives, arrays, and plain objects (recursively).
 */
type JsValue = string | number | boolean | null | JsValue[] | {
    [key: string]: JsValue;
};

/**
 * Utilities for working with TokenScript schema URIs
 *
 * Handles URI construction, parsing, and manipulation for the TokenScript schema registry.
 */
type SemanticVersion = {
    major: number;
} | {
    major: number;
    minor: number;
} | {
    major: number;
    minor: number;
    patch: number;
};

type uri = string;
type specType = string;
/**
 * Base manager class that provides common functionality for managing specifications,
 * conversions, and BFS-based conversion path resolution.
 */
declare abstract class BaseManager<TSpec, TInput, TOutput> {
    protected specs: Map<uri, TSpec>;
    protected specTypes: Map<uri, specType>;
    protected conversions: Map<uri, Map<uri, (input: TInput) => TOutput>>;
    protected parentConfig?: Config;
    protected removeVersionFromUri(uri: uri): uri;
    /**
     * Check if two URIs point to the same schema (ignoring version)
     */
    protected isSameSchemaUri(uri1: uri, uri2: uri): boolean;
    /**
     * Parse semantic version from URI
     * Example: "/api/v1/schema/srgb-color/0.0.1/" -> { major: 0, minor: 0, patch: 1 }
     */
    protected parseSemverFromUri(uri: uri): SemanticVersion | null;
    /**
     * Get base URI without version
     * Example: "/api/v1/schema/srgb-color/0.0.1/" -> "/api/v1/schema/srgb-color/"
     */
    protected getBaseUri(uri: uri): uri;
    /**
     * Generate version resolution candidates from most specific to least specific
     * Example: "0.0.1" -> ["0.0.1", "0.0", "0", "latest"]
     */
    protected generateVersionCandidates(uri: uri): uri[];
    /**
     * Find the latest (highest) semantic version for a URI
     */
    protected findLatestVersion(uri: uri): uri | null;
    /**
     * Resolve URI by trying version candidates from most specific to least specific
     */
    protected resolveVersionUri(uri: uri): uri | null;
    /**
     * Find a conversion path from source to target format using BFS with version resolution
     */
    protected findConversionPath(sourceUri: uri, targetUri: uri): uri[];
    /**
     * Check if a conversion path exists between source and target URIs with version resolution
     */
    hasConversion(sourceUri: uri, targetUri: uri): boolean;
    /**
     * Get a specification by its URI with version resolution
     */
    getSpec(uri: uri): TSpec | undefined;
    /**
     * Convert input through a chain of conversions to reach the target URI with version resolution
     */
    protected convertThroughPath(input: TInput, sourceUri: uri, targetUri: uri): TOutput;
    /**
     * Register a conversion function between two URIs
     */
    protected registerConversionFunction(sourceUri: uri, targetUri: uri, conversionFn: (input: TInput) => TOutput): void;
    abstract register(uri: uri, spec: TSpec | specType): TSpec;
    protected abstract getSpecName(spec: TSpec): string;
    /**
     * Abstract method for creating a clone of the manager
     */
    abstract clone(): this;
    /**
     * Set the parent config reference
     */
    setParentConfig(config: Config): void;
    /**
     * Get the parent config reference
     */
    getParentConfig(): Config | undefined;
    /**
     * Creates interpreter configuration with full context for conversion functions and initializers.
     * Uses parent config if available to provide access to all managers and registrations.
     */
    protected createInterpreterConfig(references: Record<string, any>): {
        references: Record<string, any>;
        config?: Config;
    };
}

type ColorSpecification = Color.ColorSpecification;

type uriType$2 = string;
type Specs$1 = Map<uriType$2, ColorSpecification>;
interface FormatColorOptions {
    decimalPlaces?: number;
    removeTrailingZeros?: boolean;
}
declare class ColorManager extends BaseManager<ColorSpecification, ColorSymbol, ColorSymbol> {
    private initializers;
    constructor(defaultSpecs?: Specs$1);
    protected getSpecName(spec: ColorSpecification): string;
    /**
     * Creates a clone of this class to be passed down to initializers and conversion functions
     * Links properties to the parent config.
     */
    clone(): this;
    registerRootInitializers(_uri: uriType$2, spec: ColorSpecification): void;
    registerConversions(uri: uriType$2, spec: ColorSpecification): void;
    register(uri: uriType$2, spec: ColorSpecification | string): ColorSpecification;
    getSpecByType(type: string): ColorSpecification | undefined;
    getSpecFromColor(color: ColorSymbol): ColorSpecification | undefined;
    hasInitializer(keyword: string): boolean;
    executeInitializer(keyword: string, args: Array<ISymbolType>): ColorSymbol;
    hasConversionByType(sourceType: string, targetType: string): boolean;
    convertTo(color: ColorSymbol, targetUri: string): ColorSymbol;
    convertToByType(color: ColorSymbol, targetType: string): ColorSymbol;
    setAttribute(color: ColorSymbol, node: ReassignNode, attributeValue: ISymbolType): ColorSymbol;
    /**
     * Formats a number value, rounding to specified decimal places and optionally removing trailing zeros.
     *
     * @param value - The numeric value to format
     * @param decimalPlaces - Number of decimal places to round to
     * @param removeTrailingZeros - Whether to remove trailing zeros
     * @returns Formatted number string
     */
    private formatNumber;
    /**
     * Formats a ColorSymbol as a string representation using the appropriate schema-defined format.
     *
     * For hex colors (string values), returns the hex string as-is.
     * For dynamic colors (object values), uses the schema's `order` property to determine
     * parameter order and formats as a function call (e.g., "hsl(0, 100, 50.0)").
     * If alpha is set and less than 1, it is included as the fourth parameter.
     *
     * @param color - The ColorSymbol to format
     * @param opts - Formatting options for numeric values
     * @returns Formatted string representation of the color, or empty string if formatting fails
     *
     * @example
     * ```typescript
     * // Hex color
     * const hexColor = new ColorSymbol("#ff0000", "Hex");
     * manager.formatColorMethod(hexColor); // "#ff0000"
     *
     * // HSL color with schema order ["h", "s", "l"]
     * const hslColor = new ColorSymbol({ h: 0, s: 100, l: 50.123456 }, "HSL");
     * manager.formatColorMethod(hslColor); // "hsl(0, 100, 50.12)"
     *
     * // RGB color with alpha
     * const rgbColor = new ColorSymbol({ r: 255, g: 0, b: 0 }, "RGB", undefined, 0.5);
     * manager.formatColorMethod(rgbColor); // "rgb(255, 0, 0, 0.5)"
     * ```
     */
    formatColorMethod(color: ColorSymbol, opts?: FormatColorOptions): string;
    getColorSchemas(): Map<string, ColorSpecification>;
}

type ConstantsSpecification = Constants.ConstantsSpecification;

type FunctionSpecification = Fn.FunctionSpecification;

type functionName = string;
type FunctionImpl = (...args: ISymbolType[]) => ISymbolType;
declare class FunctionsManager extends BaseManager<FunctionSpecification, ISymbolType[], ISymbolType> {
    private functionMap;
    constructor();
    protected getSpecName(spec: FunctionSpecification): string;
    clone(): this;
    register(name: functionName, spec: FunctionSpecification | string): FunctionSpecification;
    private setupBuiltinFunctions;
    private registerFunction;
    private registerDynamicFunction;
    getFunction(name: string): FunctionImpl | undefined;
    hasFunction(name: string): boolean;
    getFunctionNames(): string[];
    getFunctionSchemas(): Map<string, FunctionSpecification>;
    /**
     * Validate that a function call has the correct number of arguments
     * based on its schema spec. Only validates schema-registered functions
     * (not builtins which handle their own argument validation).
     */
    validateFunctionArgs(name: string, args: ISymbolType[], token?: Token): void;
}

type TokenSpecification = Token$1.TokenSpecification;

type uriType$1 = string;
/**
 * Result of validating a token value.
 * For nested validation failures, path indicates where the error occurred.
 */
interface ValidationResult {
    valid: boolean;
    error?: string;
    tokenType?: string;
    path?: (string | number)[];
}
declare class TokenManager extends BaseManager<TokenSpecification, TokenSymbol, TokenSymbol> {
    /**
     * TokenScript validation scripts by token type.
     * The script receives {input} as the value to validate.
     * Should return true if valid, or a string error code if invalid.
     */
    private validationScripts;
    /**
     * Cached parsed ASTs for validation scripts.
     * Avoids re-parsing the same script on every validation call.
     */
    private validationAstCache;
    /**
     * Cached Interpreter instances for validation scripts.
     * Reusing interpreters avoids recreating Config, SymbolTable, etc.
     */
    private validationInterpreterCache;
    protected getSpecName(spec: TokenSpecification): string;
    getSpecByType(type: string): TokenSpecification | undefined;
    clone(): this;
    register(uri: uriType$1, spec: TokenSpecification | string): TokenSpecification;
    /**
     * Register a TokenScript validation script for a token type.
     * The script receives {input} as the value to validate.
     * Accepts either a string (direct script) or an object with type and script properties (built schema).
     */
    registerValidation(tokenType: string, validation: string | {
        type: string;
        script: string;
    }): void;
    /**
     * Get validation script for a token type.
     */
    getValidation(tokenType: string): string | undefined;
    /**
     * Get possible error codes from validation scripts by walking the AST.
     * Finds all return statements that return string literals (error codes).
     *
     * @param tokenType - Optional token type to get errors for. If omitted, returns all error types.
     * @returns Array of error code strings
     */
    validationErrorTypes(tokenType?: string): string[];
    /**
     * Extract error codes from a validation script's AST.
     * Walks the tree and returns string values from return statements.
     */
    private extractErrorTypesFromAST;
    /**
     * Validate a token value against its type using TokenScript.
     * Automatically performs deep validation for nested token properties.
     * Returns an array of validation results (empty or single valid result if all pass).
     *
     * @param tokenType - The token type name (e.g., "typography", "color")
     * @param value - The symbol value to validate
     * @param visitedUrls - Set of URLs already visited (for circular reference detection)
     * @param basePath - Path prefix for nested validation errors
     * @param depth - Current nesting depth (for max depth protection)
     */
    validate(tokenType: string, value: ISymbolType, visitedUrls?: Set<string>, basePath?: (string | number)[], depth?: number): ValidationResult[];
    /**
     * Validate items in a list against an items schema.
     * Each item is validated and errors include the index in the path.
     */
    private validateListItems;
    /**
     * Validate properties of an object against a properties schema.
     */
    private validateObjectProperties;
    /**
     * Run the validation script for a token type.
     * Internal method used by validate().
     * Uses cached Interpreter when available to avoid recreation overhead.
     */
    private runValidationScript;
    /**
     * Extract a Map from various symbol types that can contain key-value pairs.
     */
    private getValueMap;
}

type UnitSpecification = Unit.UnitSpecification;

type uriType = string;
type unitKey = string;
type Specs = Map<uriType, UnitSpecification>;
declare class UnitManager extends BaseManager<UnitSpecification, NumberWithUnitSymbol, NumberWithUnitSymbol> {
    private unitKeywords;
    constructor(defaultSpecs?: Specs);
    protected getSpecName(spec: UnitSpecification): string;
    /**
     * Creates a clone of this class to be passed down to initializers and conversion functions
     * Links properties to the parent config.
     */
    clone(): this;
    registerConversions(uri: uriType, spec: UnitSpecification): void;
    register(uri: uriType, spec: UnitSpecification | string): UnitSpecification;
    getSpecByKeyword(keyword: unitKey): UnitSpecification | undefined;
    getUriByKeyword(keyword: unitKey): string | undefined;
    convertTo(unit: NumberWithUnitSymbol, targetUri: uriType): NumberWithUnitSymbol;
    private isOneNumberRelative;
    private convertRelative;
    convertToCommonFormat(inputs: Array<NumberSymbol | NumberWithUnitSymbol>): Array<NumberSymbol | NumberWithUnitSymbol>;
}

interface LanguageOptions {
    MAX_ITERATIONS: number;
}
interface ConfigOptions {
    languageOptions?: LanguageOptions;
    colorManager?: ColorManager;
    unitManager?: UnitManager;
    functionsManager?: FunctionsManager;
    tokenManager?: TokenManager;
}
declare class Config {
    languageOptions: LanguageOptions;
    colorManager: ColorManager;
    unitManager: UnitManager;
    functionsManager: FunctionsManager;
    tokenManager: TokenManager;
    private _inlineConstants;
    constructor(options?: ConfigOptions);
    getType(baseType: string, subType?: string): ISymbolType;
    isTypeDefined(baseType: string, subType?: string): boolean;
    get inlineConstants(): Map<string, string | number | boolean>;
    clone(): Config;
    registerSchemas(schemas: Array<{
        uri: string;
        schema: ColorSpecification | FunctionSpecification | TokenSpecification | ConstantsSpecification;
    }>): Config;
}

export { type ASTNode as A, Config as C, type ISymbolType as I, Operations as O, type ReferenceRecord as R, type SymbolMetadata as S, type Token as T, UNINTERPRETED_KEYWORDS as U, type ReferenceRecordValue as a, ReservedKeyword as b, SupportedFormats as c, TokenType as d };
