import { ServerRequest, ServerRequestHandler, ServerResponse } from '@frontmcp/sdk'; type Runner = (req: ServerRequest) => Promise | T; type SuccessWriter = (res: ServerResponse, result: T) => void | Promise; type ErrorWriter = (res: ServerResponse, err: any) => void | Promise; export declare function withResponseHandler(runner: Runner): { /** Set the success writer; chainable. */ success(fn: SuccessWriter): /*elided*/ any; /** * Set the error writer and finalize into a ServerHookHandler. * Calling this returns the Express-like/host handler. */ fail(fn: ErrorWriter): ServerRequestHandler; /** * If you prefer not to end with .fail(), you can call .build() after setting .success(). * It will use the default error writer unless overridden via .fail() earlier. */ build(): ServerRequestHandler; }; export {};