import { u as Token, A as ASTNode, I as ISymbolType, a as Config, y as ReferenceRecord } from './types-CpUWRnTg.js';

/**
 * Union type for serialized error data that can be passed in error data objects.
 * Used when wrapping errors from catch blocks.
 */
type SerializedError = Error | LanguageError | string | {
    message: string;
    stack?: string;
};
declare function isLanguageError(error: unknown): error is LanguageError;
declare function isLexerError(error: unknown): error is LexerError;
declare function isParserError(error: unknown): error is ParserError;
declare function isInterpreterError(error: unknown): error is InterpreterError;
declare function isProcessorError(error: unknown): error is ProcessorError;
/**
 * Serializes an error into a structured format suitable for error data.
 * Preserves error information while ensuring it's serializable.
 */
declare function serializeError(error: unknown): SerializedError;

declare enum ColorErrorCode {
    INITIALIZER_CRASHED = "COLOR_INITIALIZER_CRASHED",
    INITIALIZER_CONSTRUCT_FAILED = "COLOR_INITIALIZER_CONSTRUCT_FAILED",
    INITIALIZER_NOT_FOUND = "COLOR_INITIALIZER_NOT_FOUND",
    CONVERSION_TARGET_NOT_FOUND = "COLOR_CONVERSION_TARGET_NOT_FOUND",
    SOURCE_URI_NOT_FOUND = "COLOR_SOURCE_URI_NOT_FOUND",
    TARGET_URI_NOT_FOUND = "COLOR_TARGET_URI_NOT_FOUND",
    CONVERSION_ERROR = "COLOR_CONVERSION_ERROR",
    STRING_VALUE_ASSIGNMENT = "COLOR_STRING_VALUE_ASSIGNMENT",
    ATTRIBUTE_CHAIN_TOO_LONG = "COLOR_ATTRIBUTE_CHAIN_TOO_LONG",
    MISSING_SPEC = "COLOR_MISSING_SPEC",
    MISSING_SCHEMA = "COLOR_MISSING_SCHEMA",
    MISSING_ATTRIBUTE_SCHEMA = "COLOR_MISSING_ATTRIBUTE_SCHEMA",
    INVALID_ATTRIBUTE_TYPE = "COLOR_INVALID_ATTRIBUTE_TYPE",
    INVALID_ALPHA_VALUE = "COLOR_INVALID_ALPHA_VALUE"
}
interface ColorErrorData {
    [ColorErrorCode.INITIALIZER_CRASHED]: Record<string, never>;
    [ColorErrorCode.INITIALIZER_CONSTRUCT_FAILED]: {
        error: SerializedError;
    };
    [ColorErrorCode.INITIALIZER_NOT_FOUND]: {
        keyword: string;
    };
    [ColorErrorCode.CONVERSION_TARGET_NOT_FOUND]: {
        targetUri: string;
    };
    [ColorErrorCode.SOURCE_URI_NOT_FOUND]: {
        colorType: string;
    };
    [ColorErrorCode.TARGET_URI_NOT_FOUND]: {
        colorType: string;
    };
    [ColorErrorCode.CONVERSION_ERROR]: {
        message: string;
    };
    [ColorErrorCode.STRING_VALUE_ASSIGNMENT]: {
        attributes: string;
        identifier: string;
        colorType: string;
    };
    [ColorErrorCode.ATTRIBUTE_CHAIN_TOO_LONG]: {
        attributes: string;
        identifier: string;
        colorType: string;
    };
    [ColorErrorCode.MISSING_SPEC]: {
        identifier: string;
        colorType: string;
    };
    [ColorErrorCode.MISSING_SCHEMA]: {
        colorType: string;
    };
    [ColorErrorCode.MISSING_ATTRIBUTE_SCHEMA]: {
        attribute: string;
        identifier: string;
        colorType: string;
    };
    [ColorErrorCode.INVALID_ATTRIBUTE_TYPE]: {
        attributeType: string;
        validTypes: string;
    };
    [ColorErrorCode.INVALID_ALPHA_VALUE]: {
        alpha: number;
    };
}

declare enum ConfigErrorCode {
    NO_SPEC_FOUND = "CFG_NO_SPEC_FOUND",
    NO_TYPE_FOUND = "CFG_NO_TYPE_FOUND"
}
interface ConfigErrorData {
    [ConfigErrorCode.NO_SPEC_FOUND]: {
        specName: string;
    };
    [ConfigErrorCode.NO_TYPE_FOUND]: {
        typeName: string;
    };
}

declare enum FunctionsErrorCode {
    EXPECTS_NUMBER_ARGUMENTS = "FN_EXPECTS_NUMBER_ARGUMENTS",
    REQUIRES_MIN_ARGUMENTS = "FN_REQUIRES_MIN_ARGUMENTS",
    EXPECTS_TYPE_ARGUMENT = "FN_EXPECTS_TYPE_ARGUMENT",
    DIVISION_BY_ZERO = "FN_DIVISION_BY_ZERO",
    ARGUMENT_OUT_OF_RANGE = "FN_ARGUMENT_OUT_OF_RANGE",
    INVALID_BASE = "FN_INVALID_BASE",
    PARSE_ERROR = "FN_PARSE_ERROR",
    UNIT_CONVERSION_FAILED = "FN_UNIT_CONVERSION_FAILED",
    NO_CONFIG_AVAILABLE = "FN_NO_CONFIG_AVAILABLE",
    FUNCTION_RETURNED_NULL = "FN_FUNCTION_RETURNED_NULL",
    EXECUTION_ERROR = "FN_EXECUTION_ERROR"
}
interface FunctionsErrorData {
    [FunctionsErrorCode.EXPECTS_NUMBER_ARGUMENTS]: {
        functionName: string;
    };
    [FunctionsErrorCode.REQUIRES_MIN_ARGUMENTS]: {
        functionName: string;
        minArgs: number;
    };
    [FunctionsErrorCode.EXPECTS_TYPE_ARGUMENT]: {
        functionName: string;
        expectedType: string;
        argumentPosition: string;
    };
    [FunctionsErrorCode.DIVISION_BY_ZERO]: {
        functionName: string;
    };
    [FunctionsErrorCode.ARGUMENT_OUT_OF_RANGE]: {
        functionName: string;
        constraint: string;
    };
    [FunctionsErrorCode.INVALID_BASE]: {
        functionName: string;
        constraint: string;
    };
    [FunctionsErrorCode.PARSE_ERROR]: {
        functionName: string;
        value: string;
        base: number;
    };
    [FunctionsErrorCode.UNIT_CONVERSION_FAILED]: {
        functionName: string;
        error: SerializedError;
    };
    [FunctionsErrorCode.NO_CONFIG_AVAILABLE]: {
        functionName: string;
    };
    [FunctionsErrorCode.FUNCTION_RETURNED_NULL]: {
        functionName: string;
    };
    [FunctionsErrorCode.EXECUTION_ERROR]: {
        functionName: string;
        error: SerializedError;
    };
}

declare enum InterpreterErrorCode {
    UNKNOWN_NODE_TYPE = "INT_UNKNOWN_NODE_TYPE",
    ARITHMETIC_REQUIRES_NUMBER = "INT_ARITHMETIC_REQUIRES_NUMBER",
    UNKNOWN_BINARY_OPERATOR = "INT_UNKNOWN_BINARY_OPERATOR",
    UNARY_MINUS_NULL = "INT_UNARY_MINUS_NULL",
    UNARY_PLUS_NON_NUMBER = "INT_UNARY_PLUS_NON_NUMBER",
    UNARY_NOT_NON_BOOLEAN = "INT_UNARY_NOT_NON_BOOLEAN",
    UNKNOWN_UNARY_OPERATOR = "INT_UNKNOWN_UNARY_OPERATOR",
    UNKNOWN_REFERENCE = "INT_UNKNOWN_REFERENCE",
    UNKNOWN_FUNCTION = "INT_UNKNOWN_FUNCTION",
    INVALID_VARIABLE_NAME = "INT_INVALID_VARIABLE_NAME",
    VARIABLE_ALREADY_DEFINED = "INT_VARIABLE_ALREADY_DEFINED",
    INVALID_VARIABLE_TYPE = "INT_INVALID_VARIABLE_TYPE",
    INVALID_VALUE_FOR_VARIABLE = "INT_INVALID_VALUE_FOR_VARIABLE",
    VARIABLE_NOT_FOUND = "INT_VARIABLE_NOT_FOUND",
    ASSIGNMENT_VALUE_NULL = "INT_ASSIGNMENT_VALUE_NULL",
    TYPE_MISMATCH = "INT_TYPE_MISMATCH",
    CANNOT_ASSIGN_TYPE = "INT_CANNOT_ASSIGN_TYPE",
    METHOD_RETURNED_NULL = "INT_METHOD_RETURNED_NULL",
    METHOD_NOT_FOUND = "INT_METHOD_NOT_FOUND",
    ATTRIBUTE_RETURNED_NULL = "INT_ATTRIBUTE_RETURNED_NULL",
    ATTRIBUTE_NOT_FOUND = "INT_ATTRIBUTE_NOT_FOUND",
    CANNOT_ACCESS_ATTRIBUTES = "INT_CANNOT_ACCESS_ATTRIBUTES",
    MAX_ITERATIONS_EXCEEDED = "INT_MAX_ITERATIONS_EXCEEDED",
    WHILE_CONDITION_NOT_BOOLEAN = "INT_WHILE_CONDITION_NOT_BOOLEAN",
    IF_CONDITION_NOT_BOOLEAN = "INT_IF_CONDITION_NOT_BOOLEAN",
    UNKNOWN_ERROR = "INT_UNKNOWN_ERROR"
}
interface InterpreterErrorData {
    [InterpreterErrorCode.UNKNOWN_NODE_TYPE]: {
        nodeType: string;
    };
    [InterpreterErrorCode.ARITHMETIC_REQUIRES_NUMBER]: {
        operator: string;
        leftType: string;
        rightType: string;
    };
    [InterpreterErrorCode.UNKNOWN_BINARY_OPERATOR]: {
        operator: string;
        tokenType: string;
    };
    [InterpreterErrorCode.UNARY_MINUS_NULL]: {
        symbolType: string;
    };
    [InterpreterErrorCode.UNARY_PLUS_NON_NUMBER]: {
        value: string;
    };
    [InterpreterErrorCode.UNARY_NOT_NON_BOOLEAN]: {
        value: string;
    };
    [InterpreterErrorCode.UNKNOWN_UNARY_OPERATOR]: {
        operator: string;
    };
    [InterpreterErrorCode.UNKNOWN_REFERENCE]: {
        reference: string;
    };
    [InterpreterErrorCode.UNKNOWN_FUNCTION]: {
        functionName: string;
    };
    [InterpreterErrorCode.INVALID_VARIABLE_NAME]: {
        name: string;
    };
    [InterpreterErrorCode.VARIABLE_ALREADY_DEFINED]: {
        name: string;
    };
    [InterpreterErrorCode.INVALID_VARIABLE_TYPE]: {
        typeName: string;
        validTypes: string;
    };
    [InterpreterErrorCode.INVALID_VALUE_FOR_VARIABLE]: {
        value: string;
        type: string;
        name: string;
    };
    [InterpreterErrorCode.VARIABLE_NOT_FOUND]: {
        name: string;
    };
    [InterpreterErrorCode.ASSIGNMENT_VALUE_NULL]: {
        identifier: string;
    };
    [InterpreterErrorCode.TYPE_MISMATCH]: {
        value: string;
        foundType: string;
        expectedType: string;
        identifier: string;
    };
    [InterpreterErrorCode.CANNOT_ASSIGN_TYPE]: {
        valueType: string;
        identifier: string;
        variableType: string;
    };
    [InterpreterErrorCode.METHOD_RETURNED_NULL]: {
        methodName: string;
    };
    [InterpreterErrorCode.METHOD_NOT_FOUND]: {
        methodName: string;
        value: string;
        type: string;
    };
    [InterpreterErrorCode.ATTRIBUTE_RETURNED_NULL]: {
        attributeName: string;
    };
    [InterpreterErrorCode.ATTRIBUTE_NOT_FOUND]: {
        attributeName: string;
        value: string;
        type: string;
    };
    [InterpreterErrorCode.CANNOT_ACCESS_ATTRIBUTES]: {
        type: string;
    };
    [InterpreterErrorCode.MAX_ITERATIONS_EXCEEDED]: Record<string, never>;
    [InterpreterErrorCode.WHILE_CONDITION_NOT_BOOLEAN]: Record<string, never>;
    [InterpreterErrorCode.IF_CONDITION_NOT_BOOLEAN]: Record<string, never>;
    [InterpreterErrorCode.UNKNOWN_ERROR]: Record<string, never>;
}

declare enum LexerErrorCode {
    INVALID_CHARACTER = "LEXER_INVALID_CHARACTER",
    UNTERMINATED_STRING = "LEXER_UNTERMINATED_STRING",
    UNTERMINATED_REFERENCE = "LEXER_UNTERMINATED_REFERENCE",
    EMPTY_VARIABLE_NAME = "LEXER_EMPTY_VARIABLE_NAME",
    INVALID_HEX_COLOR_FORMAT = "LEXER_INVALID_HEX_COLOR_FORMAT",
    EXPECTED_CHARACTER = "LEXER_EXPECTED_CHARACTER"
}
interface LexerErrorData {
    [LexerErrorCode.INVALID_CHARACTER]: {
        char: string;
        position: number;
        description?: string;
    };
    [LexerErrorCode.UNTERMINATED_STRING]: {
        quoteType: string;
    };
    [LexerErrorCode.UNTERMINATED_REFERENCE]: Record<string, never>;
    [LexerErrorCode.EMPTY_VARIABLE_NAME]: Record<string, never>;
    [LexerErrorCode.INVALID_HEX_COLOR_FORMAT]: {
        value: string;
        expectedLength: string;
    };
    [LexerErrorCode.EXPECTED_CHARACTER]: {
        expected: string;
        got: string | null;
    };
}

declare enum OperationsErrorCode {
    UNSUPPORTED_OPERAND_TYPE = "OP_UNSUPPORTED_OPERAND_TYPE",
    CANNOT_MIX_UNITS = "OP_CANNOT_MIX_UNITS",
    INCOMPATIBLE_TYPES = "OP_INCOMPATIBLE_TYPES",
    CANNOT_COMPARE_UNITS = "OP_CANNOT_COMPARE_UNITS",
    ORDERING_WITH_NULL = "OP_ORDERING_WITH_NULL",
    LOGICAL_REQUIRES_BOOLEAN = "OP_LOGICAL_REQUIRES_BOOLEAN",
    DIVISION_BY_ZERO = "OP_DIVISION_BY_ZERO",
    UNIT_EXPONENT_NOT_SUPPORTED = "OP_UNIT_EXPONENT_NOT_SUPPORTED"
}
interface OperationsErrorData {
    [OperationsErrorCode.UNSUPPORTED_OPERAND_TYPE]: {
        type: string;
    };
    [OperationsErrorCode.CANNOT_MIX_UNITS]: {
        units: string;
    };
    [OperationsErrorCode.INCOMPATIBLE_TYPES]: {
        typeA: string;
        typeB: string;
    };
    [OperationsErrorCode.CANNOT_COMPARE_UNITS]: {
        unitA: string;
        unitB: string;
    };
    [OperationsErrorCode.ORDERING_WITH_NULL]: Record<string, never>;
    [OperationsErrorCode.LOGICAL_REQUIRES_BOOLEAN]: {
        operator: string;
    };
    [OperationsErrorCode.DIVISION_BY_ZERO]: Record<string, never>;
    [OperationsErrorCode.UNIT_EXPONENT_NOT_SUPPORTED]: {
        unitA: string;
        unitB: string;
    };
}

declare enum ParserErrorCode {
    UNEXPECTED_TOKEN = "PARSER_UNEXPECTED_TOKEN",
    EXPECTED_TOKEN_TYPE = "PARSER_EXPECTED_TOKEN_TYPE",
    UNEXPECTED_END = "PARSER_UNEXPECTED_END",
    CONDITION_MUST_BE_BOOLEAN = "PARSER_CONDITION_MUST_BE_BOOLEAN",
    INVALID_SYNTAX = "PARSER_INVALID_SYNTAX"
}
interface ParserErrorData {
    [ParserErrorCode.UNEXPECTED_TOKEN]: {
        token: string;
    };
    [ParserErrorCode.EXPECTED_TOKEN_TYPE]: {
        expected: string;
        got: string;
    };
    [ParserErrorCode.CONDITION_MUST_BE_BOOLEAN]: Record<string, never>;
    [ParserErrorCode.INVALID_SYNTAX]: {
        message?: string;
    };
    [ParserErrorCode.UNEXPECTED_END]: Record<string, never>;
}

declare enum ProcessorErrorCode {
    TOKEN_NOT_FOUND = "PROC_TOKEN_NOT_FOUND",
    TOKEN_ALREADY_EXISTS = "PROC_TOKEN_ALREADY_EXISTS",
    CIRCULAR_DEPENDENCY = "PROC_CIRCULAR_DEPENDENCY",
    SUB_FIELD_NOT_RESOLVED = "PROC_SUB_FIELD_NOT_RESOLVED",
    DEPENDENCY_ERROR = "PROC_DEPENDENCY_ERROR",
    NO_THEMES_FOUND = "PROC_NO_THEMES_FOUND",
    THEME_NOT_FOUND = "PROC_THEME_NOT_FOUND",
    TOKEN_SET_NOT_FOUND = "PROC_TOKEN_SET_NOT_FOUND",
    TOKEN_SET_INVALID = "PROC_TOKEN_SET_INVALID",
    NO_SETS_TO_PROCESS = "PROC_NO_SETS_TO_PROCESS",
    MULTIPLE_SETS_NO_SELECTION = "PROC_MULTIPLE_SETS_NO_SELECTION",
    UNKNOWN_PARSING_ERROR = "PROC_UNKNOWN_PARSING_ERROR",
    RESOLVER_NOT_INITIALIZED = "PROC_RESOLVER_NOT_INITIALIZED"
}
interface ProcessorErrorData {
    [ProcessorErrorCode.TOKEN_NOT_FOUND]: {
        tokenName: string;
    };
    [ProcessorErrorCode.TOKEN_ALREADY_EXISTS]: {
        tokenName: string;
    };
    [ProcessorErrorCode.CIRCULAR_DEPENDENCY]: {
        tokens: string | string[];
    };
    [ProcessorErrorCode.SUB_FIELD_NOT_RESOLVED]: {
        fieldPath: string;
    };
    [ProcessorErrorCode.DEPENDENCY_ERROR]: {
        tokenName: string;
        chain: string;
        rootCause: string;
    };
    [ProcessorErrorCode.NO_THEMES_FOUND]: {
        themeName: string;
    };
    [ProcessorErrorCode.THEME_NOT_FOUND]: {
        themeName: string;
        availableThemes: string[];
    };
    [ProcessorErrorCode.TOKEN_SET_NOT_FOUND]: {
        setName: string;
    };
    [ProcessorErrorCode.TOKEN_SET_INVALID]: {
        setName: string;
    };
    [ProcessorErrorCode.NO_SETS_TO_PROCESS]: Record<string, never>;
    [ProcessorErrorCode.MULTIPLE_SETS_NO_SELECTION]: {
        setNames: string[];
    };
    [ProcessorErrorCode.UNKNOWN_PARSING_ERROR]: {
        error?: string;
    };
    [ProcessorErrorCode.RESOLVER_NOT_INITIALIZED]: Record<string, never>;
}

declare enum SymbolsErrorCode {
    VALUE_MUST_BE_TYPE = "SYM_VALUE_MUST_BE_TYPE",
    VALUE_IS_NULL = "SYM_VALUE_IS_NULL",
    METHOD_NOT_FOUND = "SYM_METHOD_NOT_FOUND",
    MISSING_REQUIRED_ARGUMENT = "SYM_MISSING_REQUIRED_ARGUMENT",
    ATTRIBUTE_NOT_FOUND = "SYM_ATTRIBUTE_NOT_FOUND",
    CANNOT_SET_ATTRIBUTE = "SYM_CANNOT_SET_ATTRIBUTE",
    INVALID_RADIX = "SYM_INVALID_RADIX",
    RADIX_CONVERSION_ERROR = "SYM_RADIX_CONVERSION_ERROR",
    CANNOT_CONCATENATE = "SYM_CANNOT_CONCATENATE",
    CANNOT_SPLIT = "SYM_CANNOT_SPLIT",
    INDEX_OUT_OF_RANGE = "SYM_INDEX_OUT_OF_RANGE",
    KEY_MUST_BE_STRING = "SYM_KEY_MUST_BE_STRING",
    CANNOT_OPERATION_ON_TOKEN_TYPE = "SYM_CANNOT_OPERATION_ON_TOKEN_TYPE",
    INVALID_HEX_COLOR = "SYM_INVALID_HEX_COLOR",
    COLOR_MANAGER_NOT_AVAILABLE = "SYM_COLOR_MANAGER_NOT_AVAILABLE",
    INVALID_COLOR_VALUE = "SYM_INVALID_COLOR_VALUE"
}
interface SymbolsErrorData {
    [SymbolsErrorCode.VALUE_MUST_BE_TYPE]: {
        expectedType: string;
        actualType: string;
    };
    [SymbolsErrorCode.VALUE_IS_NULL]: {
        expectedType: string;
    };
    [SymbolsErrorCode.METHOD_NOT_FOUND]: {
        methodName: string;
        type: string;
    };
    [SymbolsErrorCode.MISSING_REQUIRED_ARGUMENT]: {
        argumentName: string;
        methodName: string;
    };
    [SymbolsErrorCode.ATTRIBUTE_NOT_FOUND]: {
        attributeName: string;
        type: string;
    };
    [SymbolsErrorCode.CANNOT_SET_ATTRIBUTE]: {
        attributeName: string;
        type: string;
    };
    [SymbolsErrorCode.INVALID_RADIX]: {
        radix: number;
    };
    [SymbolsErrorCode.RADIX_CONVERSION_ERROR]: {
        base: number;
        error: string;
    };
    [SymbolsErrorCode.CANNOT_CONCATENATE]: {
        type: string;
    };
    [SymbolsErrorCode.CANNOT_SPLIT]: {
        type: string;
    };
    [SymbolsErrorCode.INDEX_OUT_OF_RANGE]: {
        operation: string;
    };
    [SymbolsErrorCode.KEY_MUST_BE_STRING]: {
        type: string;
    };
    [SymbolsErrorCode.CANNOT_OPERATION_ON_TOKEN_TYPE]: {
        operation: string;
        valueType: string;
    };
    [SymbolsErrorCode.INVALID_HEX_COLOR]: {
        value: string;
    };
    [SymbolsErrorCode.COLOR_MANAGER_NOT_AVAILABLE]: Record<string, never>;
    [SymbolsErrorCode.INVALID_COLOR_VALUE]: {
        value: string;
        type: string;
    };
}

declare enum UnitErrorCode {
    CONVERSION_CRASHED = "UNIT_CONVERSION_CRASHED",
    SOURCE_URI_NOT_FOUND = "UNIT_SOURCE_URI_NOT_FOUND",
    RELATIVE_REQUIRES_TWO_NUMBERS = "UNIT_RELATIVE_REQUIRES_TWO_NUMBERS",
    NO_TO_ABSOLUTE_SCRIPT = "UNIT_NO_TO_ABSOLUTE_SCRIPT",
    TO_ABSOLUTE_MUST_RETURN_NUMBER = "UNIT_TO_ABSOLUTE_MUST_RETURN_NUMBER",
    CANNOT_CONVERT_MULTIPLE_RELATIVE = "UNIT_CANNOT_CONVERT_MULTIPLE_RELATIVE",
    NO_VALID_CONVERSION_PATH = "UNIT_NO_VALID_CONVERSION_PATH"
}
interface UnitErrorData {
    [UnitErrorCode.CONVERSION_CRASHED]: {
        error: SerializedError;
    };
    [UnitErrorCode.SOURCE_URI_NOT_FOUND]: {
        unit: string;
    };
    [UnitErrorCode.RELATIVE_REQUIRES_TWO_NUMBERS]: Record<string, never>;
    [UnitErrorCode.NO_TO_ABSOLUTE_SCRIPT]: {
        unit: string;
    };
    [UnitErrorCode.TO_ABSOLUTE_MUST_RETURN_NUMBER]: Record<string, never>;
    [UnitErrorCode.CANNOT_CONVERT_MULTIPLE_RELATIVE]: Record<string, never>;
    [UnitErrorCode.NO_VALID_CONVERSION_PATH]: Record<string, never>;
}

interface ErrorOptions {
    token?: Token;
    line?: number;
    data?: Record<string, unknown>;
    cause?: unknown;
}
type AllErrorCodes = LexerErrorCode | ParserErrorCode | InterpreterErrorCode | OperationsErrorCode | SymbolsErrorCode | FunctionsErrorCode | ConfigErrorCode | ProcessorErrorCode | ColorErrorCode | UnitErrorCode;
type InterpreterErrorCodes = InterpreterErrorCode | OperationsErrorCode | SymbolsErrorCode | FunctionsErrorCode | ConfigErrorCode | ColorErrorCode | UnitErrorCode;
declare class LanguageError extends Error {
    readonly code: string;
    readonly data: Record<string, unknown>;
    readonly line?: number;
    readonly token?: Token;
    readonly originalMessage: string;
    constructor(code: string, options?: ErrorOptions);
    private formatMessage;
}
declare class LexerError extends LanguageError {
    readonly code: LexerErrorCode;
    constructor(code: LexerErrorCode, options?: ErrorOptions);
}
declare class ParserError extends LanguageError {
    readonly code: ParserErrorCode;
    constructor(code: ParserErrorCode, options?: ErrorOptions);
}
declare class InterpreterError extends LanguageError {
    readonly code: InterpreterErrorCodes;
    constructor(code: InterpreterErrorCodes, options?: ErrorOptions);
}
declare class ProcessorError extends LanguageError {
    readonly code: ProcessorErrorCode;
    constructor(code: ProcessorErrorCode, options?: ErrorOptions);
}

declare class Lexer {
    private text;
    private currentChar;
    private pos;
    private line;
    private column;
    constructor(text: string);
    private error;
    private advance;
    private eat;
    private peek;
    private skipWhitespace;
    private skipLine;
    private isComment;
    private number;
    private isDigit;
    private isValidIdentifierStart;
    private isValidStringElement;
    private stringElement;
    private reference;
    private explicitString;
    private hexColor;
    nextToken(): Token;
    peekToken(): Token | null;
    peekTokens(n: number): Token[] | null;
    isEOF(): boolean;
    getSourceInfo(): {
        text: string;
        pos: number;
        line: number;
        column: number;
    };
}

declare class Parser {
    private lexer;
    private currentToken;
    requiredReferences: Set<string>;
    constructor(lexer: Lexer);
    private formatError;
    private peekTokens;
    private error;
    private eat;
    private typeDeclaration;
    private statementsList;
    private statement;
    private assignVariable;
    private reassignVariable;
    private reference;
    private expr;
    private conditionExpr;
    private returnStatement;
    private whileStatement;
    private ifStatement;
    private block;
    private implicitListExpr;
    private listExpr;
    private logicTerm;
    private comparison;
    private term;
    private power;
    private format;
    private number;
    private factor;
    private attributeAccess;
    private functionCall;
    parse(inlineMode?: boolean): ASTNode | null;
}
interface ParseExpressionResult {
    lexer: Lexer;
    parser: Parser;
    ast: ASTNode | null;
}
declare function parseExpression(text: string): ParseExpressionResult;

declare class SymbolTable {
    private symbols;
    constructor();
    get(name: string): ISymbolType | null;
    set(name: string, value: ISymbolType | null): void;
    isDefined(name: string): boolean;
    reset(): void;
}

type InterpreterResult = ISymbolType | string | null;
declare class Interpreter {
    private parser;
    private symbolTable;
    private references;
    private ast;
    config: Config;
    constructor(input: Parser | ASTNode | null, options?: {
        references?: ReferenceRecord | Map<string, any>;
        symbolTable?: SymbolTable;
        config?: Config;
    });
    importReferences(references?: ReferenceRecord | Map<string, any>): void;
    getReference(key: string): ISymbolType | undefined;
    setAst(ast: ASTNode | null): void;
    resetSymbolTable(): void;
    getSymbol(name: string): ISymbolType | null;
    coerceValue(constructorSymbol: ISymbolType, valueSymbol: ISymbolType): ISymbolType | undefined;
    private visit;
    private visitBinOpNode;
    private visitNumNode;
    private visitStringNode;
    /**
     * Bare identifiers are treated as string literals if not found as variables
     * Check symbol table first (variables override references), then references
     */
    private visitIdentifierNode;
    private visitUnaryOpNode;
    private visitListNode;
    private visitImplicitListNode;
    private visitReferenceNode;
    private visitHexColorNode;
    private visitBooleanNode;
    private visitNullNode;
    private visitElementWithUnitNode;
    private visitFunctionCallNode;
    private visitAssignNode;
    private visitReassignNode;
    private visitAttributeAccessNode;
    private visitStatementListNode;
    private visitReturnNode;
    private visitWhileNode;
    private visitIfNode;
    interpret(): InterpreterResult;
}

export { type AllErrorCodes as A, SymbolsErrorCode as B, type ColorErrorData as C, serializeError as D, type ErrorOptions as E, type FunctionsErrorData as F, UnitErrorCode as G, InterpreterError as I, LanguageError as L, type OperationsErrorData as O, ProcessorError as P, type SerializedError as S, type UnitErrorData as U, LexerError as a, ParserError as b, Interpreter as c, type InterpreterResult as d, Lexer as e, Parser as f, type ConfigErrorData as g, type InterpreterErrorData as h, type LexerErrorData as i, type ParserErrorData as j, type ProcessorErrorData as k, type SymbolsErrorData as l, ColorErrorCode as m, ConfigErrorCode as n, FunctionsErrorCode as o, parseExpression as p, InterpreterErrorCode as q, isInterpreterError as r, isLanguageError as s, isLexerError as t, isParserError as u, isProcessorError as v, LexerErrorCode as w, OperationsErrorCode as x, ParserErrorCode as y, ProcessorErrorCode as z };
