/**
 * A class to parse ESM Scripts and extract attribute metadata from JSDoc comments.
 * This class uses the TypeScript compiler API to parse the script and extract the metadata.
 */
export class ScriptParser {
    /**
     * @param {import('@typescript/vfs').VirtualTypeScriptEnvironment} env - The TypeScript virtual environment
     * @param {number} [maxDepth] - The maximum recursion depth
     */
    constructor(env: import("@typescript/vfs").VirtualTypeScriptEnvironment, maxDepth?: number);
    env: import("@typescript/vfs").VirtualTypeScriptEnvironment;
    program: ts.Program;
    typeChecker: ts.TypeChecker;
    maxDepth: number;
    typeSerializerMap: Map<any, any>;
    allSupportedTypesSet: Set<ts.Type>;
    attributeParser: AttributeParser;
    /**
     * Checks a program for compile errors and returns a list of formatted error messages.
     * @param {ValidationError[]} errors - The array to store error messages
     * @returns {boolean} - True if the program has no errors, false otherwise
     */
    validateProgram(errors?: ValidationError[]): boolean;
    /**
     * @typedef {Object} ParserOptions
     * @property {object} [attributes] - The attributes object to add to
     * @property {ParsingError[]} [errors] - The array to store parsing errors
     * @property {boolean} [requiresAttributeTag] - Whether the attribute requires an @attribute tag
     * @property {number} [depth] - The current recursion depth
     */
    /**
     * Extracts Script Attributes from JSDoc style tag from a AST node
     *
     * @param {import('typescript').Node} node - The TypeScript node to analyze
     * @param {ParserOptions} [opts] - The input options
     * @returns {Attribute[]} - The extracted attributes;
     */
    extractAttributes(node: import("typescript").Node, opts?: {
        /**
         * - The attributes object to add to
         */
        attributes?: object;
        /**
         * - The array to store parsing errors
         */
        errors?: ParsingError[];
        /**
         * - Whether the attribute requires an
         */
        requiresAttributeTag?: boolean;
    }): Attribute[];
}
export type Attribute = {
    /**
     * - The type of the attribute
     */
    type: string;
    /**
     * - Whether the attribute is an array type of not
     */
    array: boolean;
    /**
     * - The description of the attribute
     */
    description?: string;
    /**
     * - Placeholder for Editor's for field UI.
     */
    placeholder?: string;
    /**
     * - The default value of the attribute
     */
    defaultValue?: any;
    /**
     * - An array of possible values for the attribute
     */
    enum?: {
        [x: string]: number | boolean | string;
    }[];
    /**
     * - Numerical constraints for the attribute
     */
    range?: {
        min: number;
        max: number;
    };
    /**
     * - Numerical constraints for the attribute
     */
    precision?: number;
    /**
     * - Numerical constraints for the attribute
     */
    step?: number;
    /**
     * - Name of asset type to be used in 'asset' type attribute
     */
    resource?: string;
};
export type ValidationError = {
    /**
     * - The error message
     */
    message: string;
    /**
     * - The file the error occurred in
     */
    file?: string;
    /**
     * - The line the error occurred on
     */
    line?: number;
    /**
     * - The column the error occurred on
     */
    column?: number;
    /**
     * - The length of the error
     */
    length?: number;
};
import * as ts from 'typescript';
import { AttributeParser } from './attribute-parser.js';
import { ParsingError } from './parsing-error.js';
