import type { Comparator } from "@rickosborne/typical"; import type { Dirent } from "node:fs"; /** * Options for {@link copyRecursiveSync}. */ export type CopyRecursiveOptions = { /** * Override the implementation of the copy-file operation. * Mostly used for unit tests. */ copyFileSync?: (source: string, destination: string) => void; /** * If the filter function returns true, copy the item. * @defaultValue {@link copyRecursiveFilterDefault} */ keepIf?: (dirEnt: Dirent) => boolean; /** * Override the implementation of the console.log operation. * Mostly used for unit tests. */ log?: (message: string) => void; /** * Override the implementation of the make-directory operation. * Mostly used for unit tests. */ mkdirSync?: (path: string, options: { recursive: true; }) => void; /** * Callback when a file or directory is copied, such as for logging. */ onCopy?: (sourceDirEnt: Dirent, destination: string) => void; /** * Overwrite a file if it already exists. * @defaultValue false */ overwrite?: boolean; /** * Override the implementation of the read-directory operation. * Mostly used for unit tests. */ readdirSync?: (path: string, options: { recursive: false; encoding: "utf8"; withFileTypes: true; }) => Dirent[]; /** * Override the order in which items are copied. */ sort?: Comparator; /** * Whether to log out each file or directory as it is copied. */ verbose?: boolean; }; export type CopyRecursiveResult = { fileCount: number; dirCount: number; totalCount: number; }; export declare const copyRecursiveFilterDefault: (dirEnt: Dirent) => boolean; export declare const copyRecursiveSync: (source: string, destination: string, options?: CopyRecursiveOptions) => CopyRecursiveResult; //# sourceMappingURL=copy-recursive.d.ts.map