/** * Centralized path resolution for backup operations. * * This module provides the SINGLE source of truth for all backup path resolution. * All consumers (backup, export, CLI commands) should use this module instead of * implementing their own path logic. * * @module audiotools-config/path-resolver */ import type { BackupSource } from './types.js'; /** * Default backup root directory */ export declare const DEFAULT_BACKUP_ROOT: string; /** * Resolve the backup path for a given source. * * This is the single function that determines where backup data is stored. * Path structure: {backupRoot}/{sampler}/{device}/ * * For remote sources: * - Uses hostname (without .local suffix) as sampler name * - Example: pi-scsi2.local:~/images/ → ~/.audiotools/backup/pi-scsi2/images * * For local sources: * - Uses explicit sampler name from config * - Example: /Volumes/S3K with sampler="s3k" → ~/.audiotools/backup/s3k/hard-drive * * @param source - Backup source configuration * @param backupRoot - Optional backup root directory (defaults to ~/.audiotools/backup) * @returns Absolute path to backup directory * @throws Error if required fields are missing * * @example * ```typescript * const source: BackupSource = { * name: 's3k-hard-drive', * type: 'local', * source: '/Volumes/S3K', * device: 'hard-drive', * sampler: 's3k', * enabled: true * }; * * const path = resolveBackupPath(source); * // => '/Users/orion/.audiotools/backup/s3k/hard-drive' * ``` */ export declare function resolveBackupPath(source: BackupSource, backupRoot?: string): string;