/**
 * Utilities for copying directories and files with exclusions
 */
import type { Ignore } from "ignore";
/**
 * Safely create a directory (and parents) without throwing on EEXIST.
 *
 * `mkdir` with `{ recursive: true }` is supposed to be idempotent, but
 * cloud-sync tools like OneDrive can create the directory between the
 * internal existence check and the actual syscall, causing a spurious
 * EEXIST error on Windows.  This wrapper absorbs that race.
 */
export declare function ensureDir(path: string): Promise<void>;
/**
 * Synchronous version of {@link ensureDir}.
 */
export declare function ensureDirSync(path: string): void;
/**
 * Normalize a path for cross-platform comparison.
 * Converts Windows backslashes to forward slashes so that exclusion
 * patterns work consistently on both Windows and Unix systems.
 *
 * @param p - The path to normalize
 * @returns The path with all backslashes converted to forward slashes
 */
export declare function normalizePath(p: string): string;
/**
 * Check if a target path is safe (doesn't escape the base directory)
 * Protects against path traversal attacks
 */
export declare function isPathSafe(basePath: string, targetPath: string): boolean;
interface CopyOptions {
    /** Paths to exclude (relative to source root or base names) */
    exclude?: string[];
    /** Gitignore-style filter for common junk patterns (via the `ignore` package) */
    ignoreFilter?: Ignore;
    /** Whether to skip scripts for the opposite platform */
    skipOppositeScripts?: boolean;
}
/**
 * Copy a single file using Bun's file API
 * @throws Error if the copy operation fails
 */
export declare function copyFile(src: string, dest: string): Promise<void>;
/**
 * Check if a path should be excluded based on exclusion rules.
 * Uses normalized paths (forward slashes) to ensure consistent matching
 * on both Windows and Unix systems.
 *
 * When an {@link Ignore} filter is provided, gitignore-style glob patterns
 * are evaluated first so common junk files (.DS_Store, node_modules, etc.)
 * are filtered automatically without polluting the explicit `exclude` list.
 */
export declare function shouldExclude(relativePath: string, name: string, exclude: string[], ignoreFilter?: Ignore): boolean;
/**
 * Recursively copy a directory, overwriting existing destination files.
 */
export declare function copyDir(src: string, dest: string, options?: CopyOptions, rootSrc?: string, rootDest?: string): Promise<void>;
/**
 * Recursively copy a directory without overwriting existing destination files.
 */
export declare function copyDirNonDestructive(src: string, dest: string, options?: CopyOptions, rootSrc?: string, rootDest?: string): Promise<void>;
/**
 * Check if a path exists
 */
export declare function pathExists(path: string): Promise<boolean>;
/**
 * Check if a path is a directory
 */
export declare function isDirectory(path: string): Promise<boolean>;
/**
 * Check if a file is empty or contains only whitespace.
 *
 * A file is considered empty if:
 * - It does not exist (returns true to allow overwrite)
 * - It has 0 bytes
 * - It contains only whitespace characters (for files under 1KB)
 *
 * @param path - The path to the file to check
 * @returns true if the file is empty or whitespace-only, false otherwise
 */
export declare function isFileEmpty(path: string): Promise<boolean>;
export {};
//# sourceMappingURL=copy.d.ts.map