import type { ProcessHost } from './ProcessHost.ts'; /** Lifecycle state of one active runtime session. */ export type RuntimeSessionState = 'active' | 'failed' | 'stopped' | 'stopping'; /** Application-owned cleanup invoked when a runtime session stops. */ export type RuntimeStopDelegate = () => Promise | void; /** Application-owned work invoked for the first process interrupt. */ export type RuntimeInterruptListener = () => Promise | void; /** * Instance-scoped owner for one runtime cleanup operation. * * Every call to {@link stop} returns the same promise. A cleanup failure is * retained and rethrown without wrapping so callers can preserve their * existing fail-fast behavior. */ export declare class RuntimeSession { private _exitCode?; private _exitHost?; private _exitPromise?; private _hasInterruptBinding; private _interruptDisposer?; private _interruptPromise?; private _isInterruptDisposed; private _state; private readonly _stopDelegate; private _stopError?; private _stopPromise?; constructor(stopDelegate: RuntimeStopDelegate); get state(): RuntimeSessionState; get stopError(): unknown; bindInterrupt(host: Pick, listener: RuntimeInterruptListener): void; /** * Coalesces competing process-exit requests for this session. Requests made * in the same turn retain the highest exit code and every caller observes * the same exactly-once exit operation. */ requestExit(host: Pick, exitCode: number): Promise; stop(): Promise; private disposeInterrupt; private handleInterrupt; private stopOnce; } //# sourceMappingURL=RuntimeSession.d.ts.map