import type { TerminalRuntimeSession } from "../runtime-session.ts";
export interface ForegroundDetachGateOptions {
    readonly runtime: TerminalRuntimeSession;
    readonly signal: AbortSignal | undefined;
    readonly delayMs: number;
    /** Removes the foreground abort listener at the detach linearization point. */
    readonly removeAbortListener: () => void;
}
export interface ForegroundDetachGate {
    /** Resolves only after detach has committed; it remains pending when exit or abort wins. */
    readonly detached: Promise<void>;
    cancel(): void;
}
/**
 * Race a foreground command's cache deadline against exit and abort without
 * introducing an observable gap between the final checks and promotion. The
 * native session's `onExit` calls already-settled listeners, which makes the
 * listener registration a linearization gate rather than a best-effort peek.
 */
export declare function createForegroundDetachGate(options: ForegroundDetachGateOptions): ForegroundDetachGate;
//# sourceMappingURL=foreground-detach.d.ts.map