import * as Effect from "effect/Effect"; import * as Fiber from "effect/Fiber"; /** * The per-signal shutdown decision, isolated from process wiring for direct * tests. * * The first signal interrupts the running fiber and waits for its finalizers * to finish — restoration, lock release, and settlement recording take the * time they take, and truncating them is what loses workspaces. A fiber whose * operation boundary converts the interruption into its own terminal * resolution completes itself (document, exit code, and disposition all flow * through the normal pipeline); only a fiber that ends interrupted without * resolving falls back to the minimal termination notice. A second signal is * the user's insistence: it forces the termination notice and process exit * without waiting for finalizers. * * @internal Exported for direct tests; not part of the module's public * surface. */ export declare const makeSignalShutdown: (args: { readonly fiber: Fiber.Fiber; readonly runFork: (effect: Effect.Effect) => unknown; readonly terminate?: (exitCode: number, signal: "SIGINT" | "SIGTERM") => void; }) => ((exitCode: number, signal: "SIGINT" | "SIGTERM") => void); /** * Wrap a program in signal-aware graceful shutdown. * * SIGTERM/SIGINT → record the signal and interrupt the running fiber, letting * finalizers finish; a second signal forces abort. Exit codes follow POSIX * convention (128 + signum): SIGINT=130, SIGTERM=143. Uses Effect.forkChild * (supervised) so the fiber dies with parent. */ export declare const withGracefulShutdown: (program: Effect.Effect) => Effect.Effect; //# sourceMappingURL=graceful-shutdown.d.ts.map