/** * Check if a path is safe (no traversal attempts). * Detects: * - Directory traversal (../) * - Null bytes (\0) * * @param userPath - Path to validate * @returns true if path is safe */ export declare function isPathSafe(userPath: string): boolean; /** * Validate an output path for file operations. * Throws if the path is invalid or contains traversal attempts. * * @param filePath - Path to validate * @throws Error if path is invalid */ export declare function validateOutputPath(filePath: string): void; /** * Safely join paths with traversal protection. * The resulting path is validated to not escape the base directory. * * @param basePath - Base directory (must be absolute) * @param userPath - User-provided path component * @returns Joined and validated path * @throws Error if the result would escape basePath */ export declare function safeJoinPath(basePath: string, userPath: string): string; /** * Validate that a path doesn't contain any dangerous characters. * This is an additional layer of protection for paths that will be used * in contexts where special characters could cause issues. * * @param filePath - Path to validate * @returns true if path contains only safe characters */ export declare function hasSafeCharacters(filePath: string): boolean; /** * Sanitize a filename by removing or replacing dangerous characters. * Use this for user-provided filenames that need to be safe. * * @param filename - Filename to sanitize * @returns Sanitized filename */ export declare function sanitizeFilename(filename: string): string; //# sourceMappingURL=path.d.ts.map