/** * Platform information */ export interface PlatformInfo { platform: 'win32' | 'darwin' | 'linux'; isWindows: boolean; isMac: boolean; isLinux: boolean; homeDir: string; separator: string; } /** * Path resolution result */ export interface PathResolutionResult { absolutePath: string; isValid: boolean; error?: string; platform: string; } /** * PathResolver Service * Handles cross-platform path resolution and validation * * Design Principles: * - All paths must be absolute * - Platform-specific validation (Windows drive letters, Unix root) * - Home directory expansion support (~) * - Environment variable expansion (%VAR% on Windows, $VAR on Unix) */ export declare class PathResolverService { private readonly platformInfo; constructor(); /** * Get current platform information */ getPlatformInfo(): PlatformInfo; /** * Resolve a path to an absolute path with platform-specific handling * @param inputPath - The path to resolve (can include ~ or env vars) * @param fallbackPath - Optional fallback if resolution fails * @returns Resolution result with absolute path or error */ resolve(inputPath: string, fallbackPath?: string): PathResolutionResult; /** * Get default download path for current platform * @returns Platform-specific default download directory */ getDefaultDownloadPath(): string; /** * Expand home directory shorthand (~) * Works on all platforms */ private expandHomeDirectory; /** * Expand environment variables * - Windows: %VAR% * - Unix: $VAR or ${VAR} */ private expandEnvironmentVariables; /** * Normalize path separators for current platform */ private normalizeSeparators; /** * Check if path is absolute (platform-aware) * This is more reliable than path.isAbsolute() for cross-platform testing */ private isPathAbsolute; /** * Validate path for current platform * @returns Error message if invalid, undefined if valid */ private validatePlatformPath; /** * Validate Windows-specific path requirements */ private validateWindowsPath; /** * Validate Unix-specific path requirements (Mac/Linux) */ private validateUnixPath; /** * Format a path example for current platform * Useful for error messages and UI placeholders */ getPathExample(type: 'downloads' | 'documents' | 'desktop' | 'custom'): string; /** * Check if a path is safe (no directory traversal) * This is a secondary check after resolution */ isSafePath(absolutePath: string): boolean; } //# sourceMappingURL=path-resolver.service.d.ts.map