/** * Platform information. */ interface PlatformInfo { /** Operating system */ os: 'darwin' | 'linux' | 'win32' | 'freebsd' | 'sunos' | 'aix' | 'other'; /** CPU architecture */ arch: string; /** Node.js version */ nodeVersion: string; /** Is Windows */ isWindows: boolean; /** Is macOS */ isMac: boolean; /** Is Linux */ isLinux: boolean; /** File system case sensitivity */ caseSensitive: boolean; /** Path separator for platform */ pathSeparator: '/' | '\\'; /** Line ending for platform */ lineEnding: '\n' | '\r\n'; } /** * Detect if file system is case sensitive. * * @returns True if file system is case-sensitive * * @example Detecting case sensitivity * ```typescript * if (detectCaseSensitivity()) { * // Linux: 'File.ts' and 'file.ts' are different files * } else { * // Windows/macOS: treat as same file * } * ``` */ declare function detectCaseSensitivity(): boolean; /** * Check if file system is case-sensitive. * * @returns True if file system is case-sensitive * * @example Checking case sensitivity * ```typescript * const caseSensitive = isCaseSensitiveFs() * // => true on Linux, false on Windows/macOS * ``` */ declare function isCaseSensitiveFs(): boolean; /** * Get comprehensive platform information. * * @returns Platform information object (cached after first call) * * @example Getting platform information * ```typescript * const info = getPlatformInfo() * console.log(info.os) // => 'linux' * console.log(info.pathSeparator) // => '/' * console.log(info.lineEnding) // => '\n' * ``` */ declare function getPlatformInfo(): PlatformInfo; /** * Detect current platform. * * @returns Platform information object * * @example Detecting current platform * ```typescript * const platform = detectPlatform() * if (platform.isWindows) { * // Windows-specific handling * } * ``` */ declare function detectPlatform(): PlatformInfo; /** * Check if running on Windows. * * @returns True if running on Windows * * @example Checking for Windows * ```typescript * if (isWindows()) { * // Use Windows-specific paths or commands * } * ``` */ declare function isWindows(): boolean; /** Unix line ending */ declare const LF = "\n"; /** Windows line ending */ declare const CRLF = "\r\n"; /** * Target specification for normalizing line endings. */ type LineEndingStyle = 'lf' | 'crlf' | 'auto'; /** * Result of analyzing line endings in content. */ type DetectedLineEnding = 'lf' | 'crlf' | 'mixed' | 'none'; /** * Get platform-appropriate line ending. * * @returns Line ending for current platform * * @example Getting platform line ending * ```typescript * const eol = getLineEnding() * const lines = ['line1', 'line2', 'line3'] * const content = lines.join(eol) * ``` */ declare function getLineEnding(): '\n' | '\r\n'; /** * Get platform-appropriate path separator. * * @returns Path separator for current platform * * @example Getting platform path separator * ```typescript * const sep = getPathSeparator() * const fullPath = ['src', 'utils', 'helpers.ts'].join(sep) * ``` */ declare function getPathSeparator(): '/' | '\\'; /** * Normalize line endings in content. * * @param content - Content to normalize * @param style - Target line ending style ('lf', 'crlf', or 'auto' for platform default) * @returns Content with normalized line endings * * @example Normalizing line endings * ```typescript * // Normalize to Unix line endings * const normalized = normalizeLineEndings('line1\r\nline2\r\n', 'lf') * // => 'line1\nline2\n' * * // Use platform default * const platformNormalized = normalizeLineEndings(content, 'auto') * ``` */ declare function normalizeLineEndings(content: string, style?: LineEndingStyle): string; /** * Detect line ending style used in content. * * @param content - Content to analyze * @returns Detected line ending style * * @example Detecting line ending style * ```typescript * const ending = detectLineEnding('line1\nline2\n') * // => 'lf' * * const mixed = detectLineEnding('line1\r\nline2\nline3') * // => 'mixed' * ``` */ declare function detectLineEnding(content: string): DetectedLineEnding; /** * Compare paths with case sensitivity awareness. * * @param path1 - First path * @param path2 - Second path * @returns True if paths are equal (respecting case sensitivity) * * @example Comparing paths * ```typescript * // On case-insensitive filesystem (Windows/macOS) * pathsEqual('src/App.tsx', 'src/app.tsx') * // => true * * // On case-sensitive filesystem (Linux) * pathsEqual('src/App.tsx', 'src/app.tsx') * // => false * ``` */ declare function pathsEqual(path1: string, path2: string): boolean; export { CRLF, LF, detectCaseSensitivity, detectLineEnding, detectPlatform, getLineEnding, getPathSeparator, getPlatformInfo, isCaseSensitiveFs, isWindows, normalizeLineEndings, pathsEqual }; export type { DetectedLineEnding, LineEndingStyle, PlatformInfo };