import { ABORT } from '../consts.js'; /** * * * 复制文件夹,并且支持模板文件 * * 1. 支持深度复制文件夹,保持文件夹结构 * 2. 支持模板文件,模板文件以 .art 结尾,复制后去掉 .art后缀,采用art-template渲染 3. 支持忽略文件或文件夹 4. 支持文件或文件夹重命名 copyFiles("/temp/a*.ts", targetDir, options) * */ interface CopyFileInfo { file?: string; source?: string; target?: string; vars?: null | undefined | Record; } interface CopyFilesOptions { vars?: Record | ((file: string) => Record | Promise>); ignore?: string[]; clean?: boolean; cwd?: string; overwrite?: boolean | ((filename: string) => boolean | Promise); before?: (info: CopyFileInfo) => void | typeof ABORT; after?: (info: CopyFileInfo) => void | typeof ABORT; error?: (error: Error, { source, target }: { source: string; target: string; }) => void | typeof ABORT; templateOptions?: Record | ((file: string) => Record | Promise>); } /** * 拷贝满足条件的文件到目标文件夹 * * @param pattern * @param targetDir * @param options * @returns 返回实际拷贝的文件列表 */ declare function copyFiles(pattern: string, targetDir: string, options?: CopyFilesOptions): Promise; export { type CopyFileInfo, type CopyFilesOptions, copyFiles };