import { type PublicReleaseRingId } from '@happier-dev/release-runtime/releaseRings';
type RelayRuntimeMode = 'user' | 'system';
type RelayRuntimePlatform = NodeJS.Platform;
type RelayRuntimeBackend = 'systemd-user' | 'systemd-system' | 'launchd-user' | 'launchd-system' | 'schtasks-user' | 'schtasks-system';
type RelayRuntimeServiceRaw = Readonly<{
    unitFileState?: string | null;
    activeState?: string | null;
    subState?: string | null;
}> | Readonly<{
    exists?: boolean | null;
    enabled?: boolean | null;
    active?: boolean | null;
    stateLabel?: string | null;
}> | Readonly<{
    loaded?: boolean | null;
    pid?: number | null;
    lastExitStatus?: number | null;
}>;
export type RelayRuntimeDefaults = Readonly<{
    channel: PublicReleaseRingId;
    mode: RelayRuntimeMode;
    installRoot: string;
    binDir: string;
    configDir: string;
    dataDir: string;
    logDir: string;
    serviceName: string;
    serverHost: string;
    serverPort: number;
    healthPath: string;
}>;
export type RelayRuntimeNormalizedStatus = Readonly<{
    installed: boolean;
    version: string | null;
    service: Readonly<{
        backend: RelayRuntimeBackend;
        installed: boolean;
        enabled: boolean;
        active: boolean;
        stateLabel: string;
    }>;
    health: Readonly<{
        reachable: boolean;
        portOpen: boolean;
        pingOk: boolean;
        url: string;
    }>;
}>;
export type RelayRuntimeHealthResult = Readonly<{
    reachable: boolean;
    portOpen: boolean;
    pingOk: boolean;
    url: string;
    statusCode: number | null;
    version: string | null;
}>;
export declare function resolveRelayRuntimeDefaults(params?: Readonly<{
    platform?: RelayRuntimePlatform;
    mode?: RelayRuntimeMode;
    channel?: PublicReleaseRingId;
    homeDir?: string;
}>): RelayRuntimeDefaults;
export declare function normalizeRelayRuntimeStatus(params: Readonly<{
    platform?: RelayRuntimePlatform;
    installVersion: string | null;
    service: Readonly<{
        backend: RelayRuntimeBackend;
        raw: RelayRuntimeServiceRaw;
    }>;
    health: Readonly<{
        portOpen: boolean;
        pingOk: boolean;
        url: string;
    }>;
}>): RelayRuntimeNormalizedStatus;
export declare function checkRelayRuntimeHealth(params: Readonly<{
    host: string;
    port: number;
    path?: string;
    timeoutMs: number;
    probePortOpen: (params: Readonly<{
        host: string;
        port: number;
        timeoutMs: number;
    }>) => Promise<boolean>;
    fetchJson: (params: Readonly<{
        url: string;
        timeoutMs: number;
    }>) => Promise<Readonly<{
        ok: boolean;
        status: number;
        body: unknown;
    }>>;
}>): Promise<RelayRuntimeHealthResult>;
export {};
//# sourceMappingURL=relayRuntime.d.ts.map