/** * Resolve a path that may be relative, absolute, or use home directory notation. * * @example * ```typescript PathUtils.resolvePath('~/docs/file.md'); // Returns: '/Users/username/docs/file.md' * * PathUtils.resolvePath('../file.md', '/current/working/dir'); // Returns: '/current/working/file.md' ```; * * @param path - The path to resolve (supports ~/, relative, and absolute paths) * @param basePath - Optional base directory for relative path resolution * * @returns Resolved absolute path */ declare function resolvePath(path: string, basePath?: string): string; /** Convert an absolute path back to a relative path from a base directory */ declare function makeRelative(absolutePath: string, fromDir: string): string; /** Update a relative path when a file is moved */ declare function updateRelativePath(originalLinkPath: string, sourceFilePath: string, newSourceFilePath: string, movedPaths?: Map): string; /** Update a Claude import path when a file is moved */ declare function updateClaudeImportPath(originalImportPath: string, sourceFilePath: string, newSourceFilePath: string, movedPaths?: Map): string; /** Normalize path separators for cross-platform compatibility */ declare function normalizePath(path: string): string; /** Check if a path is within a given directory */ declare function isWithinDirectory(filePath: string, directoryPath: string): boolean; /** Generate a unique filename if a file already exists */ declare function generateUniqueFilename(desiredPath: string): string; /** Validate that a path is safe for file operations */ declare function validatePath(path: string): { valid: boolean; reason?: string; }; /** Extract directory depth from a path */ declare function getDirectoryDepth(path: string): number; /** Find common base directory for multiple paths */ declare function findCommonBase(paths: string[]): string; /** Convert Windows paths to Unix-style for markdown links */ declare function toUnixPath(path: string): string; /** Get file extension with fallback handling */ declare function getExtension(path: string): string; /** Check if path represents a markdown file */ declare function isMarkdownFile(path: string): boolean; /** Safely join paths, handling edge cases */ declare function safejoin(...parts: string[]): string; /** Check if a path is a directory */ declare function isDirectory(path: string): boolean; /** Check if a path looks like a directory (ends with / or ) */ declare function looksLikeDirectory(path: string): boolean; /** * Resolve destination path when target might be a directory If destination is a directory, * preserves the source filename */ declare function resolveDestination(sourcePath: string, destinationPath: string): string; /** * Utility namespace for path manipulation and resolution operations. * * Provides comprehensive path handling for markdown file operations including relative path * updates, home directory resolution, and cross-platform compatibility. * * @category Utilities * * @example * Path resolution ```typescript // Resolve various path formats PathUtils.resolvePath('~/docs/file.md'); // Home directory PathUtils.resolvePath('../guide.md', '/current/dir'); // Relative PathUtils.resolvePath('/absolute/path.md'); // Absolute ``` * * @example * Relative path updates for moved files ```typescript // When moving a file, update its relative links const originalLink = '../images/diagram.png'; const updatedLink = PathUtils.updateRelativePath( originalLink, 'docs/guide.md', // old file location 'tutorials/guide.md' // new file location ); // Result: '../../docs/images/diagram.png' ``` */ export declare const PathUtils: { resolvePath: typeof resolvePath; makeRelative: typeof makeRelative; updateRelativePath: typeof updateRelativePath; updateClaudeImportPath: typeof updateClaudeImportPath; normalizePath: typeof normalizePath; isWithinDirectory: typeof isWithinDirectory; generateUniqueFilename: typeof generateUniqueFilename; validatePath: typeof validatePath; getDirectoryDepth: typeof getDirectoryDepth; findCommonBase: typeof findCommonBase; toUnixPath: typeof toUnixPath; getExtension: typeof getExtension; isMarkdownFile: typeof isMarkdownFile; safejoin: typeof safejoin; isDirectory: typeof isDirectory; looksLikeDirectory: typeof looksLikeDirectory; resolveDestination: typeof resolveDestination; }; export {}; //# sourceMappingURL=path-utils.d.ts.map