export interface IReplaceAliasOptions {
    /** 项目根目录（绝对路径） */
    rootDir: string;
    /** alias 映射关系：alias => 对应的真实目录（相对于项目根目录） */
    aliasMap: Record<string, string>;
    /** 需要扫描的目录列表（相对于项目根目录） */
    scanDirs: Array<string>;
    /** 需要扫描的根目录文件（相对于项目根目录） */
    scanRootFiles?: Array<string>;
    /** 支持的文件扩展名，默认 ['.vue', '.js', '.ts', '.less', '.css', '.scss'] */
    supportedExtensions?: Array<string>;
}
interface IReplaceResult {
    replaced: boolean;
    error: string | null;
}
/**
 * 递归获取目录下所有匹配扩展名的文件
 * @example
 * ```ts
 * // 默认扫描 .vue/.js/.ts/.less/.css/.scss
 * const files = getAllFiles('/path/to/src');
 *
 * // 自定义扫描扩展名
 * const tsFiles = getAllFiles('/path/to/src', ['.ts', '.tsx']);
 * ```
 */
export declare function getAllFiles(dirPath: string, extensions?: Array<string>, fileList?: Array<string>): Array<string>;
/**
 * 将 alias 路径转换为相对路径
 * @example
 * ```ts
 * toRelativePath(
 *   '/proj/src/views/Home/index.vue',
 *   'src',
 *   'components/Button/index.vue',
 *   '/proj',
 *   { src: 'src' },
 * );
 * // '../../components/Button/index.vue'
 * ```
 */
export declare function toRelativePath(filePath: string, alias: string, subPath: string, rootDir: string, aliasMap: Record<string, string>): string;
/**
 * 替换单个文件中的 alias 引入为相对路径
 * @example
 * ```ts
 * // 假设文件内原本写的是 `from 'src/components/Btn.vue'`
 * // 调用后会被改写为 `from '../../components/Btn.vue'`
 * const result = replaceAliasInFile(
 *   '/proj/src/views/Home/index.vue',
 *   '/proj',
 *   { src: 'src' },
 * );
 * // { replaced: true, error: null }
 * ```
 */
export declare function replaceAliasInFile(filePath: string, rootDir: string, aliasMap: Record<string, string>): IReplaceResult;
/**
 * 收集所有需要扫描的文件列表
 * @example
 * ```ts
 * const files = collectFiles({
 *   rootDir: '/proj',
 *   aliasMap: { src: 'src' },
 *   scanDirs: ['src/views', 'src/components'],
 *   scanRootFiles: ['vite.config.ts'],
 * });
 * ```
 */
export declare function collectFiles(options: IReplaceAliasOptions): Array<string>;
/**
 * 执行 alias 路径替换
 * @param options - 替换配置
 * @returns 替换统计信息
 * @example
 * ```ts
 * const { replacedCount, errorCount } = replaceAlias({
 *   rootDir: '/proj',
 *   aliasMap: {
 *     src: 'src',
 *     '@': 'src',
 *   },
 *   scanDirs: ['src'],
 *   scanRootFiles: ['vite.config.ts', 'tsconfig.json'],
 *   supportedExtensions: ['.ts', '.vue', '.scss'],
 * });
 * console.log(`替换了 ${replacedCount} 个文件，${errorCount} 个出错`);
 * ```
 */
export declare function replaceAlias(options: IReplaceAliasOptions): {
    replacedCount: number;
    errorCount: number;
};
export {};
