UNPKG

pgit-cli

Version:

Private file tracking with dual git repositories

93 lines 2.63 kB
import { FileSystemService } from './filesystem.service'; import { BaseError } from '../errors/base.error'; /** * Symbolic link service errors */ export declare class SymlinkError extends BaseError { readonly code = "SYMLINK_ERROR"; readonly recoverable = true; } export declare class SymlinkCreateError extends BaseError { readonly code = "SYMLINK_CREATE_ERROR"; readonly recoverable = true; } export declare class SymlinkValidationError extends BaseError { readonly code = "SYMLINK_VALIDATION_ERROR"; readonly recoverable = true; } /** * Symbolic link information */ export interface SymlinkInfo { /** Path to the symbolic link */ linkPath: string; /** Target path that the link points to */ targetPath: string; /** Whether the link exists */ exists: boolean; /** Whether the link is valid (target exists) */ isValid: boolean; /** Whether the link is healthy (exists and valid) */ isHealthy: boolean; /** Any issues with the link */ issues: string[]; } /** * Symbolic link creation options */ export interface SymlinkOptions { /** Force creation (overwrite existing) */ force?: boolean; /** Create parent directories if they don't exist */ createParents?: boolean; /** Whether target is a directory */ isDirectory?: boolean; } /** * Platform-specific symbolic link service */ export declare class SymlinkService { private readonly fileSystem; constructor(fileSystem?: FileSystemService); /** * Create a symbolic link */ create(targetPath: string, linkPath: string, options?: SymlinkOptions): Promise<void>; /** * Validate if a symbolic link is healthy */ validate(linkPath: string): Promise<SymlinkInfo>; /** * Repair a broken symbolic link */ repair(linkPath: string, newTargetPath: string): Promise<void>; /** * Remove a symbolic link safely */ remove(linkPath: string): Promise<void>; /** * Get the target of a symbolic link */ getTarget(linkPath: string): Promise<string>; /** * Check if platform supports symbolic links */ static supportsSymlinks(): Promise<boolean>; /** * Validate parameters for link creation */ private validateCreateParameters; /** * Create Unix-style symbolic link */ private createUnixSymlink; /** * Create Windows-style symbolic link using mklink */ private createWindowsSymlink; /** * Validate that a link was created successfully */ private validateLink; } //# sourceMappingURL=symlink.service.d.ts.map