UNPKG

@oletizi/lib-device-uuid

Version:

Cross-platform device UUID detection for Akai sampler backup tools

46 lines (45 loc) 1.54 kB
import type { DeviceDetectorInterface, DeviceInfo } from '../types.js'; /** * Linux device detector using blkid and findmnt * * This detector uses findmnt to map mount paths to device paths, * and blkid to extract device UUID and filesystem information. */ export declare class LinuxDetector implements DeviceDetectorInterface { /** * Detect device information for a mount path on Linux * @param mountPath - The path where the device is mounted * @returns Device information extracted from blkid/findmnt * @throws Error if device cannot be detected or platform not supported */ detectDevice(mountPath: string): Promise<DeviceInfo>; /** * Get device path from mount path using findmnt * @param mountPath - The mount path to resolve * @returns Device path (e.g., /dev/sdb1) * @throws Error if mount path not found */ private getDevicePath; /** * Get device information using blkid * @param devicePath - The device path (e.g., /dev/sdb1) * @returns Partial device information */ private getDeviceInfo; /** * Parse blkid export format output * @param output - The output from blkid -o export * @returns Parsed device information */ private parseBlkidOutput; /** * Check if Linux platform is supported * @returns true if running on linux platform */ isSupported(): boolean; /** * Get the platform identifier * @returns 'linux' platform constant */ getPlatform(): "linux"; }