export interface ShutdownHandler {
    name: string;
    handler: () => void | Promise<void>;
}
/**
 * Register a handler to be called during graceful shutdown.
 * Handlers are called in reverse registration order (LIFO).
 */
export declare function registerShutdownHandler(name: string, handler: () => void | Promise<void>): void;
/**
 * Clear all registered shutdown handlers (for testing).
 */
export declare function clearShutdownHandlers(): void;
/**
 * Check if the daemon is currently shutting down.
 */
export declare function isShutdownInProgress(): boolean;
/**
 * Track an in-flight request. Call the returned function when the request completes.
 * During shutdown, the orchestrator waits for all in-flight requests to drain.
 */
export declare function trackInflight(): () => void;
/**
 * Get the number of in-flight requests (for testing/monitoring).
 */
export declare function getInflightCount(): number;
/**
 * Execute the graceful shutdown sequence:
 * 1. Stop accepting new requests (mark as shutting down)
 * 2. Wait for in-flight requests to complete (with timeout)
 * 3. Run registered shutdown handlers (reverse order)
 * 4. Close SQLite connection
 * 5. Remove PID file
 *
 * The entire sequence is wrapped in an overall timeout. If shutdown
 * takes longer than SHUTDOWN_TIMEOUT_MS, remaining steps are skipped
 * and shutdown completes with a warning.
 */
export declare function gracefulShutdown(): Promise<void>;
//# sourceMappingURL=shutdown.d.ts.map