import { IEnvironmentConfig } from './environment'; /** * Path type enum for different package paths */ export declare enum PathType { /** Root directory of the CLI workspace */ CLI_ROOT = "CLI_ROOT", /** Private application distribution directory */ PRIVATE_APP_DIST = "PRIVATE_APP_DIST", /** Private application root directory */ PRIVATE_APP_ROOT = "PRIVATE_APP_ROOT", /** Public libs templates directory */ PUBLIC_LIBS_TEMPLATES = "PUBLIC_LIBS_TEMPLATES", /** Public libs UI web directory */ PUBLIC_LIBS_UI_WEB = "PUBLIC_LIBS_UI_WEB" } /** * Path resolver interface */ export interface IPathResolver { /** * Resolves a path based on the current environment * @param {PathType} pathType - Type of path to resolve * @returns {string} Resolved path */ resolvePath(pathType: PathType): string; /** * Gets the CLI workspace root path * @returns {string} Path to CLI workspace root */ getCliRoot(): string; /** * Gets the private application distribution directory path * @returns {string} Path to private application dist directory */ getPrivateAppDistDir(): string; /** * Gets the private application root directory path * @returns {string} Path to private application root directory */ getPrivateAppRootDir(): string; /** * Gets the public libs templates directory path * @returns {string} Path to public libs templates directory */ getPublicLibsTemplatesDir(): string; /** * Gets the public libs UI web directory path * @returns {string} Path to public libs UI web directory */ getPublicLibsUiWebDir(): string; } /** * Path resolver class for resolving paths based on environment * @class PathResolver * @implements {IPathResolver} * * @description * This class provides centralized path resolution for all packages in the CLI. * It detects the environment (development vs production) and resolves paths accordingly: * - In development: Uses workspace-relative paths * - In production: Uses require.resolve to find installed packages * * This eliminates the need for try-catch error handling scattered across the codebase. * * @example * ```typescript * const pathResolver = new PathResolver(); * const templatesDir = pathResolver.getPublicLibsTemplatesDir(); * console.log(`Templates directory: ${templatesDir}`); * ``` */ export declare class PathResolver implements IPathResolver { private envConfig; private cliRoot; constructor(envConfig?: IEnvironmentConfig); /** * Resolves a path based on the path type and environment * @param {PathType} pathType - Type of path to resolve * @returns {string} Resolved path * @throws {Error} If path cannot be resolved */ resolvePath(pathType: PathType): string; /** * Gets the CLI workspace root path * @returns {string} Path to CLI workspace root */ getCliRoot(): string; /** * Gets the private application distribution directory path * @returns {string} Path to private application dist directory */ getPrivateAppDistDir(): string; /** * Gets the private application root directory path * @returns {string} Path to private application root directory */ getPrivateAppRootDir(): string; /** * Gets the public libs templates directory path * @returns {string} Path to public libs templates directory */ getPublicLibsTemplatesDir(): string; /** * Gets the public libs UI web directory path * @returns {string} Path to public libs UI web directory */ getPublicLibsUiWebDir(): string; /** * Finds the project root by looking for package.json with workspaces * @param {string} startDir - Directory to start searching from * @returns {string} Path to project root * @throws {Error} If project root cannot be found * @private */ private findProjectRootWithWorkspaces; }