/// <reference types="node" resolution-mode="require"/>
import { type ChildProcess } from 'child_process';
import closeWithGrace from 'close-with-grace';
import { type App } from './apps.server.ts';
type DevProcessesMap = Map<string, {
    color: (typeof colors)[number];
    process: ChildProcess;
    port: number;
}>;
type OutputLine = {
    type: 'stdout' | 'stderr';
    content: string;
    timestamp: number;
};
type TestProcessEntry = {
    process: ChildProcess | null;
    output: Array<OutputLine>;
    exitCode?: number | null;
};
type TestProcessesMap = Map<string, TestProcessEntry>;
declare global {
    var __process_dev_close_with_grace_return__: ReturnType<typeof closeWithGrace>;
    var __process_test_close_with_grace_return__: ReturnType<typeof closeWithGrace>;
}
declare const colors: readonly ["blue", "green", "yellow", "red", "magenta", "redBright", "greenBright", "yellowBright", "blueBright", "magentaBright"];
export declare function runAppDev(app: App): Promise<{
    readonly status: "process-running";
    readonly running: true;
    readonly error?: undefined;
    readonly portNumber?: undefined;
} | {
    readonly status: "error";
    readonly error: "no-server";
    readonly running?: undefined;
    readonly portNumber?: undefined;
} | {
    readonly status: "port-unavailable";
    readonly running: false;
    readonly portNumber: number;
    readonly error?: undefined;
} | {
    readonly status: "process-started";
    readonly running: true;
    readonly error?: undefined;
    readonly portNumber?: undefined;
}>;
export declare function runAppTests(app: App): Promise<import("execa").ExecaReturnValue<string> | {
    readonly status: "error";
    readonly error: "no-test";
}>;
export declare function waitOnApp(app: App): Promise<void>;
export declare function isPortAvailable(port: number | string): Promise<boolean>;
export declare function isAppRunning(app: {
    name: string;
}): boolean;
export declare function isTestRunning(app: {
    name: string;
}): boolean;
export declare function getTestProcessEntry(app: {
    name: string;
}): TestProcessEntry | undefined;
export declare function clearTestProcessEntry(app: {
    name: string;
}): boolean;
export declare function getProcesses(): {
    devProcesses: DevProcessesMap;
    testProcesses: TestProcessesMap;
};
export declare function closeProcess(key: string): Promise<void>;
export declare function stopPort(port: string | number): Promise<void>;
export declare function waitForPortToBeAvailable(port: string | number): Promise<void>;
export {};
