/**
 * Abort Signal Middleware
 * Provides client disconnection handling for long-running requests
 */
import type { MiddlewareDefinition, ServerContext } from "../types.js";
/**
 * Abort signal middleware options
 */
export type AbortSignalMiddlewareOptions = {
    /** Callback when abort is triggered */
    onAbort?: (ctx: ServerContext) => void;
    /** Request timeout in milliseconds */
    timeout?: number;
};
/**
 * Create abort signal middleware for handling client disconnections.
 *
 * This middleware creates an AbortController and attaches its signal to the context,
 * allowing route handlers to check for client disconnection during long-running operations.
 *
 * @param options - Optional configuration
 * @returns Middleware that attaches abort signal to context
 *
 * @example
 * ```typescript
 * const abortMiddleware = createAbortSignalMiddleware();
 * server.registerMiddleware(abortMiddleware);
 *
 * // In route handler:
 * const signal = ctx.abortSignal;
 * await longRunningOperation({ signal });
 * ```
 */
export declare function createAbortSignalMiddleware(options?: AbortSignalMiddlewareOptions): MiddlewareDefinition;
/**
 * Express-specific middleware factory.
 * Use this directly with Express adapter for optimal handling.
 *
 * This is a lower-level middleware that works directly with Express
 * request/response objects rather than the unified ServerContext.
 *
 * @param options - Optional configuration
 * @returns Express middleware function
 *
 * @example
 * ```typescript
 * // In Express adapter
 * app.use(createExpressAbortMiddleware());
 *
 * // Access in route handler
 * app.get('/api/stream', (req, res) => {
 *   const signal = res.locals.abortSignal;
 *   // Use signal for cancellation
 * });
 * ```
 */
export declare function createExpressAbortMiddleware(options?: AbortSignalMiddlewareOptions): (req: unknown, res: {
    on: (event: string, cb: () => void) => void;
    writableFinished?: boolean;
    locals: Record<string, unknown>;
}, next: () => void) => void;
