/** * Cross-platform utilities for OS-specific operations * Copyright (c) 2026 Mihajlo Stojanovski */ import { SupportedPlatform } from "./constants"; /** * Command execution result */ export interface CommandResult { stdout: string; stderr: string; exitCode: number; } /** * Check if current platform is supported */ export declare function isSupportedPlatform(platform?: string): platform is SupportedPlatform; /** * Get current platform */ export declare function getPlatform(): SupportedPlatform; /** * Normalize a Node.js platform value to a supported reporter platform. */ export declare function normalizeSupportedPlatform(platform?: string): SupportedPlatform | null; /** * Check if running on Windows */ export declare function isWindows(): boolean; /** * Check if running on macOS */ export declare function isMac(): boolean; /** * Check if running on Linux */ export declare function isLinux(): boolean; /** * Execute shell command with timeout and proper error handling * * @param command - Command to execute * @param timeout - Timeout in milliseconds (default: 10 seconds) * @returns Command result * @throws {PlatformError} If command fails or times out */ export declare function executeCommand(command: string, timeout?: number): Promise; /** * Get platform-specific command to open files * * @returns Command string (without arguments) */ export declare function getOpenCommand(): string; /** * Open file with default application * * @param filePath - Absolute path to file * @throws {PlatformError} If opening fails */ export declare function openFile(filePath: string): Promise; /** * Normalize path separators for current platform * * @param filePath - Path to normalize * @returns Normalized path */ export declare function normalizePath(filePath: string): string; /** * Escape path for shell command * * @param filePath - Path to escape * @returns Escaped path safe for shell execution */ export declare function escapeShellPath(filePath: string): string; /** * Check if command is available on system * * @param command - Command name to check * @returns True if command exists */ export declare function isCommandAvailable(command: string): Promise; /** * Get platform-specific environment separator * * @returns Path separator (: for Unix, ; for Windows) */ export declare function getPathSeparator(): string; /** * Get platform information for diagnostics */ export interface PlatformInfo { platform: SupportedPlatform; arch: string; release: string; nodeVersion: string; isCI: boolean; [key: string]: unknown; } /** * Get comprehensive platform information * * @returns Platform diagnostics */ export declare function getPlatformInfo(): PlatformInfo; /** * Detect if running in CI environment * * @returns True if running in CI */ export declare function isCI(): boolean; /** * Get CI environment name * * @returns CI platform name or 'local' */ export declare function getCIEnvironment(): string; /** * Decide whether browser-opening behavior should be enabled. * * Local runs default to enabled for convenience. * CI runs default to disabled unless explicitly forced on. */ export declare function shouldAutoOpenReport(explicit?: boolean): boolean; //# sourceMappingURL=platform.d.ts.map