import { ABORT } from '../consts.js'; import { CopyFileInfo } from './copyFiles.js'; /** * * * 复制文件夹,并且支持模板文件 * * 1. 支持深度复制文件夹,保持文件夹结构 * 2. 支持模板文件,模板文件以 .art 结尾,复制后去掉 .art后缀,采用art-template渲染 3. 支持忽略文件或文件夹 4. 支持文件或文件夹重命名 * */ interface CopyDirsOptions { vars?: Record | ((file: string) => Record | Promise>); pattern?: string; ignore?: string[]; clean?: boolean; 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>); } declare function copyDirs(srcDir: string, targetDir: string, options?: CopyDirsOptions): Promise; export { ABORT, type CopyDirsOptions, CopyFileInfo, copyDirs };