import { type TailscaleStatusSnapshot } from './statusSnapshot.js';
export type TailscaleCommandResult = Readonly<{
    command: string;
    args: ReadonlyArray<string>;
    exitCode: number;
    stdout: string;
    stderr: string;
}>;
export type TailscaleCommandRequest = Readonly<{
    command: string;
    args: ReadonlyArray<string>;
    env?: NodeJS.ProcessEnv;
    timeoutMs?: number;
}>;
export type TailscaleCommandRunner = (request: TailscaleCommandRequest) => Promise<TailscaleCommandResult>;
export declare class TailscaleCommandError extends Error {
    readonly result: TailscaleCommandResult;
    constructor(message: string, result: TailscaleCommandResult);
}
export type ResolveTailscaleCommandOnPath = (command: string, env: NodeJS.ProcessEnv) => Promise<string | null> | string | null;
type ResolveTailscaleBinDeps = Readonly<{
    resolveCommandOnPath?: ResolveTailscaleCommandOnPath;
    isExecutable?: (path: string) => Promise<boolean> | boolean;
}>;
type ResolveTailscaleBinParams = Readonly<{
    env?: NodeJS.ProcessEnv;
}>;
type RunTailscaleDeps = ResolveTailscaleBinDeps & Readonly<{
    resolveTailscaleBin?: (params: ResolveTailscaleBinParams) => Promise<string> | string;
    runCommand?: TailscaleCommandRunner;
}>;
type RunTailscaleParams = Readonly<{
    env?: NodeJS.ProcessEnv;
    tailscaleBin?: string;
    timeoutMs?: number;
}>;
export type RunTailscaleServeEnableParams = RunTailscaleParams & Readonly<{
    upstreamUrl: string;
    servePath?: string;
}>;
export type RunTailscaleServeEnableResult = Readonly<{
    approvalUrl: string | null;
    httpsUrl: string | null;
    rawStatus: string;
}>;
export type RunTailscaleLoginResult = Readonly<{
    usedQr: boolean;
    result: TailscaleCommandResult;
    actionUrl: string | null;
}>;
export declare function sanitizeTailscaleEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
export declare function resolveTailscaleBin(params?: ResolveTailscaleBinParams, deps?: ResolveTailscaleBinDeps): Promise<string>;
export declare function extractTailscaleServeApprovalUrl(text: string): string | null;
export declare function runTailscaleVersion(params?: RunTailscaleParams, deps?: RunTailscaleDeps): Promise<string>;
export declare function runTailscaleStatus(params?: RunTailscaleParams, deps?: RunTailscaleDeps): Promise<string>;
export declare function runTailscaleStatusJson(params?: RunTailscaleParams, deps?: RunTailscaleDeps): Promise<TailscaleStatusSnapshot>;
export declare function runTailscaleLogin(params?: RunTailscaleParams, deps?: RunTailscaleDeps): Promise<RunTailscaleLoginResult>;
export declare function runTailscaleUp(params?: RunTailscaleParams & Readonly<{
    extraArgs?: ReadonlyArray<string>;
}>, deps?: RunTailscaleDeps): Promise<TailscaleCommandResult>;
export declare function runTailscaleDown(params?: RunTailscaleParams, deps?: RunTailscaleDeps): Promise<TailscaleCommandResult>;
export declare function runTailscaleServeStatus(params?: RunTailscaleParams, deps?: RunTailscaleDeps): Promise<string>;
export declare function runTailscaleServeEnable(params: RunTailscaleServeEnableParams, deps?: RunTailscaleDeps): Promise<RunTailscaleServeEnableResult>;
export declare function runTailscaleServeReset(params?: RunTailscaleParams, deps?: RunTailscaleDeps): Promise<void>;
export {};
//# sourceMappingURL=commandRunner.d.ts.map