import type { Platform, ServiceManager } from "../utils/platform.js"; import type { Nullable } from "../types/index.js"; /** * Options for generating a service file. */ export interface ServiceOptions { envVars?: Record; } /** * Interface for platform-specific service generators. */ export interface ServiceGenerator { generate(options: ServiceOptions): string; getInstallPath(): string; install(content: string): Promise; isInstalled(): Promise; isRunning(): Promise; platform: Platform; serviceManager: ServiceManager; start(): Promise; stop(): Promise; uninstall(): Promise; } /** * Paths extracted from an existing service file. */ export interface ServicePaths { entryPoint: string; nodePath: string; } /** * Result of stale path detection. */ export interface StalePathResult { entryPoint?: string; nodePath?: string; stale: boolean; } /** * Reads the existing service file and extracts the node binary and PrismCast entry point paths. Each platform has its own format: launchd plist XML, systemd unit * ExecStart line, or Windows marker file with explicit path entries. * @returns The extracted paths, or null if the file doesn't exist or can't be parsed. */ export declare function getServicePaths(): Nullable; /** * Checks whether the paths in the existing service file still exist on disk. This detects the common post-upgrade scenario where Homebrew or npm has moved the * installation to a new versioned directory and the old paths no longer resolve. * @returns A StalePathResult indicating which paths are missing, or null if the service file doesn't exist or can't be parsed. */ export declare function detectStalePaths(): Nullable; /** * Returns the service generator for the current platform. * @returns The appropriate ServiceGenerator, or null if the platform is not supported. */ export declare function getServiceGenerator(): Nullable; /** * Collects environment variables that should be persisted in the service file. This includes settings that differ from defaults or have been explicitly configured. * @returns A record of environment variable names to values. */ export declare function collectServiceEnvironment(): Record;