/**
 * Swift child-process utilities: compilation (ensureSwiftBinary) and
 * lifecycle management for screen-streamer and input-injector.
 */
import { type ChildProcess } from "node:child_process";
/** Directory containing the Swift source files (same as this module). */
export declare const SWIFT_SRC_DIR: string;
/**
 * Ensure a compiled Swift binary is up to date.
 * Compiles the .swift source if the binary is missing or stale.
 * Returns the path to the compiled binary.
 */
export declare function ensureSwiftBinary(name: string, frameworks?: string[]): Promise<string>;
/** Callback invoked with stdout data chunks from the screen-streamer. */
export type StreamerDataCallback = (chunk: Buffer) => void;
/**
 * Lines from screen-streamer stderr that are purely internal progress noise.
 * Promote them to `debug` so the default console only shows lifecycle events
 * that actually matter to an operator watching the terminal.
 *
 * Kept at `system` (visible by default): `Capture started …` and errors.
 */
export declare const STREAMER_DEBUG_PATTERNS: readonly RegExp[];
/**
 * Build a line-buffered emitter for a child process stream. Chunks from
 * `stream.on("data")` have no line-boundary guarantees — they may bundle
 * several lines together (which we saw leak out as "bare" terminal output)
 * or split a single line across chunks. Buffer the tail until a newline is
 * observed, then flush each complete line through `onLine`.
 */
export declare function createLineBuffer(onLine: (line: string) => void): (chunk: Buffer) => void;
/**
 * Start the screen-streamer Swift process using the `swift` interpreter
 * (not a pre-compiled binary) so it inherits the terminal's Screen Recording
 * entitlement from macOS System Preferences.
 *
 * @returns The spawned ChildProcess.
 */
export declare function startStreamerProcess(onData: StreamerDataCallback, onExit: (code: number | null) => void): ChildProcess;
/**
 * Start the input-injector compiled binary.
 *
 * @param binPath - Path to the compiled input-injector binary.
 * @returns The spawned ChildProcess.
 */
export declare function startInjectorProcess(binPath: string, onExit: (code: number | null) => void): ChildProcess;
/** Terminate a child process gracefully with SIGTERM. */
export declare function killProcess(proc: ChildProcess | null, label: string): void;
//# sourceMappingURL=swift-process.d.ts.map